GithubHelp home page GithubHelp logo

eightypop / postcss-input-range Goto Github PK

View Code? Open in Web Editor NEW

This project forked from csstools/postcss-input-range

0.0 1.0 0.0 16 KB

Use unprefixed input range selectors in CSS

Home Page: https://github.com/jonathantneal/postcss-input-range

License: Creative Commons Zero v1.0 Universal

JavaScript 49.74% CSS 50.26%

postcss-input-range's Introduction

Input Range PostCSS Logo

NPM Version Build Status Licensing Changelog Gitter Chat

Input Range lets you style input ranges with unprefixed selectors.

/* before */

::range-track {
	background: #3071a9;
	width: 100%;
}

::range-thumb {
	border-radius: 3px;
	cursor: pointer;
}

/* after */

::-moz-range-track {
	background: #3071a9;
	width: 100%;
}

::-ms-track {
	background: #3071a9;
	width: 100%;
}

::-webkit-slider-runnable-track {
	background: #3071a9;
	width: 100%;
}

::-moz-range-thumb {
	border-radius: 3px;
	cursor: pointer;
}

::-ms-thumb {
	border-radius: 3px;
	cursor: pointer;
}

::-webkit-slider-thumb {
	border-radius: 3px;
	cursor: pointer;
}

Supported selectors

::range-track

Styles the track of a range.

::range-thumb

Styles the thumb of a range.

::range-lower

Styles the lower track of a range before the thumb. Only supported in Firefox, Edge and IE 10+.

::range-upper

Styles the upper track of a range after the thumb. Only supported in Edge and IE 10+.

Options

method

Type: String Default: 'replace'

clone

Copies any rules with ::range pseudo-elements to new rules using prefixes.

/* before */

::range-thumb {
	border-radius: 3px;
}

/* after */

::-moz-range-thumb {
	border-radius: 3px;
}

::-ms-thumb {
	border-radius: 3px;
}

::-webkit-slider-thumb {
	border-radius: 3px;
}

::range-thumb {
	border-radius: 3px;
}
replace

Copies any rules with ::range pseudo-elements to new rules using prefixes while removing the original.

/* before */

::range-thumb {
	border-radius: 3px;
}

/* after */

::-moz-range-thumb {
	border-radius: 3px;
}

::-ms-thumb {
	border-radius: 3px;
}

::-webkit-slider-thumb {
	border-radius: 3px;
}
warn

Warns whenever a ::range pseudo-class is found.

strict

Type: Boolean Default: true

true

Ignores prefixed ::range-type pseudo-classes.

/* before */

::-ms-thumb {
	border-radius: 3px;
}

/* after */

::-ms-thumb {
	border-radius: 3px;
}
false

Processes prefixed ::range-type pseudo-classes.

/* before */

::-ms-thumb {
	border-radius: 3px;
}

/* after */

::-moz-range-thumb {
	border-radius: 3px;
}

::-ms-thumb {
	border-radius: 3px;
}

::-webkit-slider-thumb {
	border-radius: 3px;
}

Usage

Add Input Range to your build tool:

npm install jonathantneal/postcss-input-range --save-dev

Node

require('postcss-input-range').process(YOUR_CSS, { /* options */ });

PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Load Input Range as a PostCSS plugin:

postcss([
	require('postcss-input-range')({ /* options */ })
]).process(YOUR_CSS, /* options */);

Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Enable Input Range within your Gulpfile:

var postcss = require('gulp-postcss');

gulp.task('css', function () {
	return gulp.src('./src/*.css').pipe(
		postcss([
			require('postcss-input-range')({ /* options */ })
		])
	).pipe(
		gulp.dest('.')
	);
});

Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Enable Input Range within your Gruntfile:

grunt.loadNpmTasks('grunt-postcss');

grunt.initConfig({
	postcss: {
		options: {
			use: [
				require('postcss-input-range')({ /* options */ })
			]
		},
		dist: {
			src: '*.css'
		}
	}
});

postcss-input-range's People

Contributors

jonathantneal avatar jzempel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.