Skip to content

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

License

Notifications You must be signed in to change notification settings

simondud/postcss-discard-overridden-props

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postcss-discard-overridden-props

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

Example

Input

.rule1 {
  color: red;
  display: block;
  display: inline;
}

.rule2 {
  color: green;
  display: block !important;
  display: inline;
}

.rule3 {
  color: blue;
  display: block;
  display: inline !important;
}

@media (max-width: 120px) {
  .rule4 {
    color: blue;
    display: block;
    display: inline !important;
  }
}

Output

.rule1 {
  color: red;
  display: inline;
}

.rule2 {
  color: green;
  display: block !important;
}

.rule3 {
  color: blue;
  display: inline !important;
}

@media (max-width: 120px) {
  .rule4 {
    color: blue;
    display: inline !important;
  }
}

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 91.9%
  • CSS 8.1%