![]() ![]() MagicMin DOES however, NOT suck, performs flawless (so far) minification of CSS and javascript files, allows you to automatically write the compressed file with gzip headers and a php extension, defaults to using the Google Closure API for javascript minification, will base64_encode images (reasonably sized please) directly INTO your stylesheets, AND will serve the compressed, gzipped, minified, and awesome files in style until you update any of the source files included in the minified stylesheet or javascript file! (phew- long sentence with random bold!)Ĭheck out the source code of this site! You’ll see 2 meager files included: 1 stylesheet, and 1 javascript file. It was however, short, so at least it had that going for it, which my actually awesome new class “MagicMin” does not have (it weighs in at a meager 800ish lines with comments). And it sucked! It forcefully recreated the files each and every time the page was loaded, failed to compress or minify javascript files properly (resulting in some super duper errors), and overall was lame. ![]() See the Lightning CSS website for documentation.A long long time ago, I wrote about using PHP to merge and minify javascript and CSS. Lightning CSS can be used from Parcel, as a standalone library from JavaScript or Rust, using a standalone CLI, or wrapped as a plugin within any other tool. Custom transforms – The Lightning CSS visitor API can be used to implement custom transform plugins.Opt-in support for locally scoped CSS variables and other dashed identifiers.Locally scoped custom identifiers, e.g.CSS modules – Lightning CSS supports compiling a subset of CSS modules features.clamp(), round(), rem(), and mod() math functions.Space separated components in rgb and hsl functions.color() function supporting predefined color spaces such as display-p3 and xyz.lab(), lch(), oklab(), and oklch() colors.Syntax lowering – Lightning CSS parses modern CSS syntax, and generates more compatible output where needed, based on browser targets.Browserslist configuration – Lightning CSS supports opt-in browserslist configuration discovery to resolve browser targets and integrate with your existing tools and config setup.Vendor prefixing – Lightning CSS accepts a list of browser targets, and automatically adds (and removes) vendor prefixes.converting to shorter units, removing unnecessary quotation marks, etc. Removing default property sub-values which will be inferred by browsers.Converting colors to shorter hex notation where possible.Reducing calc() expressions where possible.Removing vendor prefixes that are not needed, based on the provided browser targets. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |