css-razor - css-razor uses cheerio.js to parse static html to remove unused selectors in CSS.

  •        19

css-razor is a fast way to remove unused selectors from css. Essentially, it accomplishes the same goal as uncss. However, it accomplishes this goal differently. Rather than loading a webpage in phantomjs and using document.querySelector to determine if a selector is being used, css-razor uses cheeriojs to parse static html and css files to removed unused selectors. Below is an example of building an html file from a react app created with create-react-app. The resulting HTML file can then be used for server rendering and detecting selectors with css-razor.

https://github.com/tscanlin/css-razor#readme

Dependencies:

cheerio : ^0.22.0
es6-promise : ^4.1.0
globby : ^6.1.0
isomorphic-fetch : ^2.2.1
mkdirp : ^0.5.1
postcss : ^5.2.13
yargs : ^6.6.0

Tags
Implementation
License
Platform

   




Related Projects

gulp-postcss - Pipe CSS through PostCSS processors with a single parse

  •    Javascript

PostCSS gulp plugin to pipe CSS through several plugins, but parse CSS only once.Install required postcss plugins separately. E.g. for autoprefixer, you need to install autoprefixer package.

grunt-postcss - Apply several post-processors to your CSS using PostCSS.

  •    Javascript

Apply several post-processors to your CSS using PostCSS. An array of PostCSS compatible post-processors. You can also use a function that returns an array of PostCSS post-processors.

postcss-js - PostCSS for React Inline Styles, Free Style and other CSS-in-JS

  •    Javascript

PostCSS for React Inline Styles, Radium, JSS and other CSS-in-JS.For example, to use Stylelint, RTLCSS or postcss-write-svg plugins in your workflow.

postcss-cssnext - :cyclone: PostCSS plugin to use tomorrow's CSS syntax, today.

  •    Javascript

PostCSS plugin to use tomorrow’s CSS syntax, today. PostCSS-cssnext is a PostCSS plugin that helps you to use the latest CSS syntax today. It transforms CSS specs into more compatible CSS so you don’t need to wait for browser support.

postcss-loader - PostCSS loader for webpack

  •    Javascript

You can read more about common PostCSS Config here.You can use different postcss.config.js files in different directories. Config lookup starts from path.dirname(file) and walks the file tree upwards until a config file is found.


awesome-postcss - A curate list about PostCSS

  •    Shell

An selected list of PostCSS resources and other things related. PostCSS does is provide a css parser and a framework for creating plugins that can analyse, lint, handle assets, optimise, create fallbacks, and otherwise transform parsed css. PostCSS parses css into an abstract syntax tree AST, passes it through a series of plugins, and then concatenates back into a string.

postcss-modules - PostCSS plugin to use CSS Modules everywhere

  •    Javascript

A PostCSS plugin to use CSS Modules everywhere. Not only at the client side. getJSON may also return a Promise.

postcss-preset-env - Convert modern CSS into something browsers understand

  •    CSS

PostCSS Preset Env lets you convert modern CSS into something most browsers can understand, determining the polyfills you need based on your targeted browsers or runtime environments. Without any configuration options, PostCSS Preset Env enables Stage 2 features and supports all browsers.

postcss-inline-svg - PostCSS plugin to reference an SVG file and control its attributes with CSS syntax

  •    Javascript

PostCSS plugin to reference an SVG file and control its attributes with CSS syntax. See PostCSS docs for examples for your environment.

sugarss - Indent-based CSS syntax for PostCSS

  •    Javascript

Indent-based CSS syntax for PostCSS.As any PostCSS custom syntax, SugarSS has source map, stylelint and postcss-sorting support out-of-box.

postcss-icss-selectors - PostCSS plugin for css modules to local-scope classes and ids

  •    Javascript

See PostCSS docs for examples for your environment. Converts every new local name in #id or .class defintion to global alias. By default returns [name]__[local]---[hash:base64:5].

autoprefixer - Parse CSS and add vendor prefixes to rules by Can I Use

  •    Javascript

PostCSS plugin to parse CSS and add vendor prefixes to CSS rules using values from Can I Use. It is recommended by Google and used in Twitter and Taobao.Autoprefixer will use the data based on current browser popularity and property support to apply prefixes for you. You can try the interactive demo of Autoprefixer.

postcss - Transforming styles with JS plugins

  •    Javascript

PostCSS is a tool for transforming styles with JS plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax, inline images, and more.PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba, and JetBrains. The Autoprefixer PostCSS plugin is one of the most popular CSS processors.

react-toolbox - A set of React components implementing Google's Material Design specification with the power of CSS Modules

  •    Javascript

React Toolbox uses CSS Modules by default to import stylesheets written using PostCSS & postcss-preset-env features. In case you want to import the components already bundled with CSS, your module bundler should be able to require these PostCSS modules. Although we recommend webpack, you are free to use whatever module bundler you want as long as it can compile and require PostCSS files located in your node_modules. If you are experiencing require errors, make sure your configuration satisfies this requirement.

postcss-assets - An asset manager for PostCSS

  •    Javascript

PostCSS Assets is an asset manager for CSS. It isolates stylesheets from environmental changes, gets image sizes and inlines files. Note: all of the listed options below are parameters for the assets object, not the top level postcss options object.

postcss-bem-linter - A BEM linter for postcss

  •    Javascript

A PostCSS plugin to lint BEM-style CSS.BEM-style describes CSS that follows a more-or-less strict set of conventions determining what selectors can be used. Typically, these conventions require that classes begin with the name of the component (or "block") that contains them, and that all characters after the component name follow a specified pattern. Original BEM methodology refers to "blocks", "elements", and "modifiers"; SUIT refers to "components", "descendants", and "modifiers". You might have your own terms for similar concepts.

gulp-autoprefixer - Prefix CSS

  •    Javascript

Issues with the output should be reported on the Autoprefixer issue tracker.Improve your JavaScript skills with this awesome ES6 course by Wes Bos. Try his free JavaScript 30 course for a taste of what to expect. You might also like his React & Sublime course.

postcss-scss - SCSS parser for PostCSS.

  •    Javascript

A SCSS parser for PostCSS.This module does not compile SCSS. It simply parses mixins as custom at-rules & variables as properties, so that PostCSS plugins can then transform SCSS source code alongside CSS.

postcss-write-svg - Write SVGs directly in CSS

  •    Javascript

Write SVG lets you write SVGs directly in CSS. @svg at-rules generate SVG elements available to CSS. Within an @svg, descendant at-rules (like @rect) are interpreted as elements, while declarations (like width) are interpreted as attributes.

postcss-normalize - Use the parts of normalize.css you need from your browserlist

  •    CSS

PostCSS Normalize lets you use the parts of normalize.css you need, based on your project’s browserlist. Use @import-normalize to determine where normalize.css rules will be included. Duplicate @import-normalize rules will be removed. See all the Options for more information.