Skip to content

jckdm/CSS-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSS parser

$ python3 main.py
Do you have more than 1 .css file? (yes/no):
Path to directory / Path to .css file:
Read [    ].css
Do you have more than 1 .html file? (yes/no):
Path to directory / Path to .html file:
Read [    ].html
Identified [ ] unique classes and [ ] unique IDs.

Unused class:  .[    ] : file1.css,  line 0, 00
Unused ID:    `#[    ] : file2.css, line 000, 0

May I remove these unused rules and output new .css files? (yes/no):
Cleaned [    ].css
  1. prompts user for path to/filename of singular or multiple .css file(s)
  2. prompts user for path to/filename of singular or multiple .html file(s)
  3. parses files
  4. prints unused classes and IDs, corresponding files and line numbers
  5. [BETA] re-writes css files without unused classes and IDs

TODO:

  1. handle :hover, :focus, etc.
  2. handle re-writing multiple files
  3. thoroughly edge case re-writing stage

About

Tool that identifies, removes, and/or defines unused classes and IDs in CSS

Topics

Resources

Stars

Watchers

Forks

Languages