Skip to content

A PostCSS plugin to add disabled attributes and disabled classes when the :disabled pseudo class is present.

License

Notifications You must be signed in to change notification settings

cocco3/postcss-disabled

Repository files navigation

PostCSS Disabled Build Status

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

postcss([ require('postcss-disabled') ])

See PostCSS docs for examples for your environment.

Options

addAttribute

type: Boolean default: true Adds the [disabled] attribute selector

/* Input */
.foo:disabled {
  background-color: #f9f9f9;
}
/* Output */
.foo:disabled,
.foo[disabled] {
  background-color: #f9f9f9;
}

addClass

type: Boolean default: false Adds a .disabled class

/* Input */
.foo:disabled {
  background-color: #f9f9f9;
}
/* Output */
.foo:disabled,
.foo.disabled {
  background-color: #f9f9f9;
}

About

A PostCSS plugin to add disabled attributes and disabled classes when the :disabled pseudo class is present.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published