Announced this week is Parcel CSS, a Rust-based CSS parser, wrapper, and minifier, positioned as a tool that offers performance and minification benefits.

Written in Rust, the tool handles CSS modular compilation as well as tree shakedown, CSS features like nesting, booleans, and level 4 color syntax. Parcel CSS was revealed on January 12 by the makers of the Parcel build tool for the web. github. Parcel CSS can be used with Parcel or as a standalone JavaScript or Rust library. It can also be packaged as a plug-in in other tools.

Developers can try a live show in the browser. according to technology flyerParcel CSS is fast not only because it was written in a native language but because it is designed to be high-performance. The tool has memory optimizations such as representing vendor prefixes using single-byte tags and parsing CSS properties into structured data instead of representing them as strings that need to be re-parsed with each use. Despite its setting for speed, Parcel CSS doesn’t compromise on size, proponents said. It can produce smaller output than other tools in many cases, as it has the ability to convert old CSS syntax used in many libraries into smaller, modern syntax. It also understands each individual CSS property.

The basis of Parcel CSS is a file Rust box cssparser, which is a browser-wide token that is used in the Firefox browser. This is intended to provide a foundation that includes basic coding and analysis. Parcel users can try out Parcel CSS by adding the following to files .parcelrc a file:

{
  "extends": "@parcel/config-default",
  "transformers": {
    "*.css": ["@parcel/transformer-css-experimental"]
  },
  "optimizers": {
    "*.css": ["@parcel/optimizer-css"]
  }
}

Users must also add a file browserlist property to their package.json to specify the target browsers for which the target CSS will be compiled.

Copyright © 2022 IDG Communications, Inc.

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *