postcss-disabled
v2.0.0
Published
PostCSS plugin to add disabled attributes and disabled classes when the :disabled pseudo class is present.
Downloads
98
Maintainers
Readme
PostCSS Disabled
PostCSS plugin to add a disabled attribute
and/or a disabled class when the :disabled pseudo class is present.
/* Input */
.foo:disabled {
background-color: #f9f9f9;
}/* Output */
.foo:disabled,
.foo[disabled] {
background-color: #f9f9f9;
}Usage
See PostCSS docs for examples for your environment.
postcss([require('postcss-disabled')]);Options
addAttribute
- type:
Boolean - default:
true - Adds a
[disabled]attribute selector
/* Input */
.foo:disabled {
background-color: #f9f9f9;
}/* Output */
.foo:disabled,
.foo[disabled] {
background-color: #f9f9f9;
}addClass
- type:
Boolean - default:
false - Adds a
.disabledclass selector
/* Input */
.foo:disabled {
background-color: #f9f9f9;
}/* Output */
.foo:disabled,
.foo.disabled {
background-color: #f9f9f9;
}