All Projects → madeleineostoja → postcss-input-style

madeleineostoja / postcss-input-style

Licence: MIT license
PostCSS plugin that adds new pseudo-elements for easily styling the inner elements of inputs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to postcss-input-style

postcss-clearfix
PostCSS plugin that adds a 'fix' argument to the 'clear' property
Stars: ✭ 47 (+193.75%)
Mutual labels:  postcss, postcss-plugin
postcss-trash-killer
It is a postcss plugin which wil be remove all unused css
Stars: ✭ 20 (+25%)
Mutual labels:  postcss, postcss-plugin
Postcss Nested Props
PostCSS plugin to unwrap nested properties.
Stars: ✭ 58 (+262.5%)
Mutual labels:  postcss, postcss-plugin
Postcss Alias
PostCSS plugin that allows you to create aliases for CSS properties
Stars: ✭ 47 (+193.75%)
Mutual labels:  postcss, postcss-plugin
Postcss Aspect Ratio Mini
A PostCSS plugin to fix an element's dimensions to an aspect ratio
Stars: ✭ 123 (+668.75%)
Mutual labels:  postcss, postcss-plugin
Postcss Import
PostCSS plugin to inline @import rules content
Stars: ✭ 1,048 (+6450%)
Mutual labels:  postcss, postcss-plugin
Postcss Less
PostCSS Syntax for parsing LESS
Stars: ✭ 93 (+481.25%)
Mutual labels:  postcss, postcss-plugin
Postcss Interpolate
PostCSS plugin for values interpolation between breakpoints.
Stars: ✭ 9 (-43.75%)
Mutual labels:  postcss, postcss-plugin
Container Query
A PostCSS plugin and Javascript runtime combination, which allows you to write container queries in your CSS the same way you would write media queries.
Stars: ✭ 119 (+643.75%)
Mutual labels:  postcss, postcss-plugin
Postcss Plugins
The "officially unofficial" consolidated list of PostCSS plugins in a ready-to-use package
Stars: ✭ 107 (+568.75%)
Mutual labels:  postcss, postcss-plugin
Postcss Icon
PostCSS plugin that adds `css icons` from icon sets
Stars: ✭ 20 (+25%)
Mutual labels:  postcss, postcss-plugin
Postcss Rtl
PostCSS plugin for RTL-adaptivity
Stars: ✭ 143 (+793.75%)
Mutual labels:  postcss, postcss-plugin
Postcss Register Custom Props
PostCSS plugin that transforms custom property registration in CSS to JS
Stars: ✭ 20 (+25%)
Mutual labels:  postcss, postcss-plugin
Postcss Triangle
PostCSS plugin to create a triangle.
Stars: ✭ 57 (+256.25%)
Mutual labels:  postcss, postcss-plugin
Postcss Banner
PostCSS plugin to add text banner and footer to resulting file
Stars: ✭ 13 (-18.75%)
Mutual labels:  postcss, postcss-plugin
Postcss Prefix Selector
Prefix all CSS rules with a selector
Stars: ✭ 75 (+368.75%)
Mutual labels:  postcss, postcss-plugin
Postcss Easing Gradients
PostCSS plugin to create smooth linear-gradients that approximate easing functions.
Stars: ✭ 689 (+4206.25%)
Mutual labels:  postcss, postcss-plugin
Postcss Position
PostCSS plugin that adds shorthand declarations for position attributes
Stars: ✭ 26 (+62.5%)
Mutual labels:  postcss, postcss-plugin
Rtlcss
Framework for transforming Cascading Style Sheets (CSS) from Left-To-Right (LTR) to Right-To-Left (RTL)
Stars: ✭ 1,363 (+8418.75%)
Mutual labels:  postcss, postcss-plugin
Postcss Viewport Height Correction
PostCSS plugin to solve the popular problem when 100vh doesn’t fit the mobile browser screen.
Stars: ✭ 137 (+756.25%)
Mutual labels:  postcss, postcss-plugin

PostCSS Input Style

NPM version Downloads Build Status

PostCSS plugin that adds new pseudo elements to inputs for easy cross-browser styling of their inner elements. Currently the only input supported is Range, more will be added as more vendor-specific pseudo selectors are made available.

Part of Rucksack - CSS Superpowers

Input

input[type="range"]::track {
  background: #9d9d9d;
  height: 3px;
}

input[type="range"]::thumb {
  background: #4286be;
  width: 16px;
  height: 8px;
}

Output

input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  background: #9d9d9d;
  height: 3px;
}

input[type="range"]::-moz-range-track  {
  -moz-appearance: none;
  background: #9d9d9d;
  height: 3px;
}

input[type="range"]::-ms-track  {
  background: #9d9d9d;
  height: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: #4286be;
  width: 16px;
  height: 8px;
}

input[type="range"]::-moz-range-thumb {
  -moz-appearance: none;
  background: #4286be;
  width: 16px;
  height: 8px;
}

input[type="range"]::-ms-thumb {
  background: #4286be;
  width: 16px;
  height: 8px;
}

input[type="range"] {
  -webkit-appearance: none;
}

input[type=range]::-moz-focus-outer {
    border: 0;
}

Notes on output:

  • Selectors are not grouped because if a browser finds a single selector it doesn't understand in a group, the whole group is ignored (see Selectors Level 3)

  • -[vendor]-appearance: none; is added so your custom styles apply. On Chrome and Safari this means you must style both ::track and ::thumb, since the appearance must be set on the root element as well

  • The additional ::-moz-focus-outer rule removes the inconsistent dotted focus outline on firefox.

Usage

postcss([ require('postcss-input-style') ])

See PostCSS docs for examples for your environment.


MIT © Sean King

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].