style-eyes
is a command-line tool for optimizing CSS files by combining related properties into shorthand forms. It helps streamline your CSS and improve performance by reducing file size.
- Combine Padding Properties: Merges
padding-top
,padding-right
,padding-bottom
, andpadding-left
into a singlepadding
property. - Combine Margin Properties: Merges
margin-top
,margin-right
,margin-bottom
, andmargin-left
into a singlemargin
property. - Combine Background Properties: Merges
background-color
,background-image
,background-position
,background-repeat
, andbackground-size
into a singlebackground
property. - Combine Border Properties: Merges
border-top-width
,border-top-style
,border-top-color
, etc., into a singleborder
property. - Combine Font Properties: Merges
font-style
,font-variant
,font-weight
,font-size
,line-height
, andfont-family
into a singlefont
property. - Combine Border Radius Properties: Merges
border-top-left-radius
,border-top-right-radius
,border-bottom-right-radius
, andborder-bottom-left-radius
into a singleborder-radius
property. - Optimize Display Properties: Merges conflicting
display
properties into a single value.
To use style-eyes
, clone the repository and install dependencies:
git clone https://github.com/happer64bit/style-eyes.git
cd style-eyes
npm install
The style-eyes
CLI tool optimizes CSS files and writes the output to a specified file. You can choose to overwrite the original file if desired.
style-eyes <inputFile> [outputFile] [-o, --overwrite]
<inputFile>
: Path to the input CSS file.[outputFile]
: Optional path to the output CSS file. If not provided, the optimized CSS will be written to<inputFile>.o.css
.-o, --overwrite
: Optional flag to overwrite the output file if it exists.
Optimize styles.css
and save the result to styles.o.css
:
style-eyes styles.css styles.o.css
Optimize styles.css
and overwrite the original file:
style-eyes styles.css -o
This project is licensed under the MIT License - see the LICENSE file for details.
GitHub: happer64bit