
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Stylesnap is a powerful CSS optimization tool that analyzes your content files, extracts used classnames and tags, and generates a minimal CSS file. Ideal for reducing CSS file size and improving web performance in TailwindCSS, Bootstrap, or custom framew
stylesnap.config.json.Install Stylesnap as a development dependency using npm:
npm install stylesnap --save-dev
Alternatively, use npx to run it directly:
npx stylesnap
Stylesnap can be used via the command line. It supports multiple options for flexibility and customization.
npx stylesnap [options]
--init
stylesnap.config.json.npx stylesnap --init
-c, --content <globPattern>
npx stylesnap -c "./src/**/*.html"
-C, --css <cssPath>
npx stylesnap -C "./src/styles.css"
-d, --defaultCss <defaultCssPath>
npx stylesnap -d "./src/default.css"
-o, --output <outputPath>
npx stylesnap -o "./dist/optimized.css"
--minifyCss
npx stylesnap --minifyCss
Stylesnap uses a configuration file named stylesnap.config.json to customize its behavior. Below is an example configuration:
{
"content": ["./src/**/*.html", "./src/**/*.jsx"],
"css": "./node_modules/bootstrap/dist/css/bootstrap.css",
"defaultCss": "./src/styles.css",
"output": "./dist/optimized.css",
"minify": true
}
content: An array of glob patterns to specify the content files where class names and tags are extracted.css: Path to the main CSS file to optimize.defaultCss: Path to the default CSS file to include in the output.output: Path to save the generated CSS file.minify: Boolean to indicate whether to minify the final CSS.Initialize the configuration file:
npx stylesnap --init
Update stylesnap.config.json with your project-specific settings:
{
"content": ["./src/**/*.html", "./src/**/*.jsx"],
"css": "./node_modules/bootstrap/dist/css/bootstrap.css",
"defaultCss": "./src/styles.css",
"output": "./dist/optimized.css",
"minify": true
}
Run Stylesnap:
npx stylesnap
The optimized CSS file will be saved at the path specified in the output field (e.g., ./dist/optimized.css).
This project is licensed under the MIT License. See the LICENSE file for details.
Developed by Ravi Kishan (ravikishan63392@gmail.com).
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request on the GitHub repository.
Start optimizing your CSS today with Stylesnap! 🚀
FAQs
Stylesnap is a powerful CSS optimization tool that analyzes your content files, extracts used classnames and tags, and generates a minimal CSS file. Ideal for reducing CSS file size and improving web performance in TailwindCSS, Bootstrap, or custom framew
We found that stylesnap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.