Skip to content
This repository was archived by the owner on Mar 23, 2020. It is now read-only.

Plugin-contrib/postcss-unused-var

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNSAFE

postcss-unused-var

Postcss plugin to safely remove the unused CSS var from your styles

Installation

npm install postcss-unused-var --save-dev

Usage

Refer the PostCSS Documentation for using this plugin.

Example

Input

:root {
  --root-var-color: red;
}
#div1 {
  --main-txt-color: blue;
  --main-padding: 15px;
  --main-bg-color: coral;
  background-color: var(--main-bg-color);
}

Output

:root {
  --root-var-color: red;
}
#div1 {
  --main-bg-color: coral;
  background-color: var(--main-bg-color);
}

Not removing the un-used variables from :root as they are available acroos the site and can be access in other stylesheet as well. So they might have used in other stylesheet so its not safe to remove them

About

postcss plugin to remove unused CSS var

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors