postcss-dynamic-value
v0.0.6
Published
PostCSS plugin that implements input actual value selectors
Maintainers
Readme
postcss-dynamic-value
PostCSS plugin that implements CSS actual value selectors for inputs.
Standard CSS attribute selectors do not capture the actual (user modified) value attribute for HTML input elements. They, instead, use the static initially set value.
This plugin allows capturing the dynamic value, by using a colon prefixed value attribute selector.
input:[value="test"]Usage
Step 1: Install plugin:
npm install --save-dev postcss postcss-dynamic-valueStep 2: Check you project for existed PostCSS config: postcss.config.js
in the project root, "postcss" section in package.json
or postcss in bundle config.
If you do not use PostCSS, add it according to official docs and set this plugin in settings.
Step 3: Add the plugin to plugins list:
module.exports = {
plugins: [
+ require('postcss-dynamic-value'),
require('autoprefixer')
]
}Step 4: Add the plugin polyfill to your HTML and activate it:
<script src="https://unpkg.com/[email protected]/polyfill.js"></script>
<script>
postCssDynamicValue(document)
</script>