项目作者: mcler

项目描述 :
PostCSS plugin, which discards overridden properties in every CSS rule.
高级语言: JavaScript
项目地址: git://github.com/mcler/postcss-discard-overridden-props.git
创建时间: 2018-07-04T15:09:16Z
项目社区:https://github.com/mcler/postcss-discard-overridden-props

开源协议:MIT License

下载


postcss-discard-overridden-rules

PostCSS plugin, which discards overridden properties in every CSS rule.

Example

Input

  1. .rule1 {
  2. color: red;
  3. display: block;
  4. display: inline;
  5. }
  6. .rule2 {
  7. color: green;
  8. display: block !important;
  9. display: inline;
  10. }
  11. .rule3 {
  12. color: blue;
  13. display: block;
  14. display: inline !important;
  15. }
  16. @media (max-width: 120px) {
  17. .rule4 {
  18. color: blue;
  19. display: block;
  20. display: inline !important;
  21. }
  22. }

Output

  1. .rule1 {
  2. color: red;
  3. display: inline;
  4. }
  5. .rule2 {
  6. color: green;
  7. display: block !important;
  8. }
  9. .rule3 {
  10. color: blue;
  11. display: inline !important;
  12. }
  13. @media (max-width: 120px) {
  14. .rule4 {
  15. color: blue;
  16. display: inline !important;
  17. }
  18. }

Options

  • log (default: false) a logging flag.
  • noDelete (default: false) a flag whether found overridden properties will be deleted (works only with log set to true).
  • ignorePrefix (default: false) a flag whether plugin ignores prefixed properties and values.
  • props (default: false) an array of string with properies allowed to proccess by plugin.