Skip to content

Instantly share code, notes, and snippets.

@AlexRogalskiy
Forked from DamonOehlman/README.md
Created June 12, 2022 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexRogalskiy/430c86c2b4763dd6ccd4d05d587b452b to your computer and use it in GitHub Desktop.
Save AlexRogalskiy/430c86c2b4763dd6ccd4d05d587b452b to your computer and use it in GitHub Desktop.
Modules in NPM that look interesting with regards to generating CSS with JS (and some other things discovered along the way).

Currently trawling NPM in search of a node module that makes working with CSS and browserified code "feel" better. My first thought was to seek out an existing project (or create one) that took a programmatic approach to CSS generation.

Here's what I've found:

Generators in Code

Shortlist

  • jcss: Some nice features, and worthy of further investigation. Looks active.

  • barber: Nice syntax, has taken into consideration namespaces. Definitely worth a look :)

Others

  • css-sourcery: general approach looks ok, too much having to write src.rule, src.compile though.

  • styleless: More programmatic generation. Using object literals pretty effectively to map to CSS.

  • csster: Similar to styless

Packaging Approaches

Shortlist

  • npm-css: Nice approach to being able to package css into node modules. Thinking it needs the ability to rewrite and namespace though to be really useful. Maybe shadow DOM stuff will make it useful though...

Others

Useful Modules

  • XCSSMatrix - Nice CSS matrix operations library, XCSSMatrix polyfill. Reckon this is pretty useful when used in conjunction with JS generated CSS.

  • mensch - CSS Parser. Likely it will be useful at some point :)

  • css-parse - Another CSS Parser.

  • csso - CSS Optimizer. Very clever from a quick glance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment