Identifies redundant CSS classes not used by the templates provided.
Project description
RedundantCSS
Current Version: V0.0.3
Contents:
Description:
This script analyzes a stylesheet and identifies redundant CSS classes not used by the templates provided. The script prints the names of all unused classes to the terminal, at which point you can go to the stylesheet and delete unused classes.
Currently this package only detects unused classes, more features are on the way!
Installation:
pip install redundantcss
Usage:
redundantcss 'stylesheet_path' 'template_path_or_template_paths'
Arguments:
-
'stylesheet_path': Path to the CSS stylesheet to be analyzed.
- If your styles.css sheet is within another folder, please specify this folder first, eg static/styles.css.
-
'template_path_or_template_paths': Path to a folder containing HTML templates or paths to individual template files.
Examples:
-
Analyze a single template:
python redundantcss.py 'styles.css' 'template.html'
-
Analyze multiple templates in a folder:
python redundantcss.py 'styles.css' 'templates/'
-
Analyze multiple templates provided as separate arguments:
python redundantcss.py 'styles.css' 'template1.html' 'template2.html' 'template3.html'
COMING SOON:
-
Use argparse for specific arguments, eg --usage, --dil, --rc
-
Give option to rewrite CSS file without redundant classes.
-
Create detect_inline_styling(). Dict with value being list of tuples.
-
Refactor functions and create more specific functions for current actions.
-
Provide clear documentation.
-
Detect media queries, id styles, and element styles.
-
Allow user to pass just the folder name containing .css file.
-
Parameterize ‘.html’ stuff.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file redundantcss-0.0.3.tar.gz
.
File metadata
- Download URL: redundantcss-0.0.3.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87cc31d11b5f71f69f8adf95d791659731b76424d885eb611606f78a0137c49 |
|
MD5 | 8af8653fe1add7c099177ae9aa98ace8 |
|
BLAKE2b-256 | 00e8e516b3366058ee5d8b167bed9f6e56f34e78a5247e4d53e32735413287ef |
File details
Details for the file redundantcss-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: redundantcss-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1985f2c702c92608241ab51ae87d2b43a923a0199a1c453e912541215b234059 |
|
MD5 | 4d76bb43ecba42e6d9b7852e48a83d9f |
|
BLAKE2b-256 | d3357893644be4fb7997a8f4bd01f153860521529af134b0be319ed95e6c6c1c |