| Crates.io | const-css-minify |
| lib.rs | const-css-minify |
| version | 0.1.8 |
| created_at | 2024-05-04 06:55:40.266216+00 |
| updated_at | 2024-05-16 14:16:30.049202+00 |
| description | Include a minified css file as an inline const in your high-performance compiled web application |
| homepage | |
| repository | https://github.com/scpso/const-css-minify |
| max_upload_size | |
| id | 1229436 |
| size | 87,801 |
Include a minified css file as an inline const in your high-performance compiled web application.
use const_css_minify::minify;
const CSS: &str = minify!("./path/to/style.css");
const_css_minify is not a good solution if your css changes out-of-step with your binary, as
you will not be able to change the css without recompiling your application.
const_css_minify will:rgb(),
rgba(), hsl() and hsla() functions (in either legacy syntax with commas or modern
syntax without commas) without changing the color. e.g. #ffffff will be substituted with
#fff, hsl(180 50 50) with #40bfbf, rgba(20%, 40%, 60%, 0.8) with #369c, etc.
const-css-minify will not attempt to calculate nested/complicated/relative rgb expressions
(which will be passed through unadulturated for the end user's browser to figure out for
itself) but many simple/literal expressions will be resolved and minified.const_css_minify will not:gz, br or deflateconst_css_minify is a lightweight solution - the current version of const_css_minify has
zero dependencies outside rust's built-in std and proc_macro libraries.
This project is licensed under the terms of the MIT License.