All Projects → google → postcss-rename

google / postcss-rename

Licence: Apache-2.0 license
Replace class names based on a customizable renaming scheme.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to postcss-rename

Postcss Aspect Ratio Mini
A PostCSS plugin to fix an element's dimensions to an aspect ratio
Stars: ✭ 123 (+59.74%)
Mutual labels:  postcss, postcss-plugin
postcss-styl
PostCSS parser plugin for converting Stylus syntax to PostCSS AST.
Stars: ✭ 15 (-80.52%)
Mutual labels:  postcss, postcss-plugin
Postcss Viewport Height Correction
PostCSS plugin to solve the popular problem when 100vh doesn’t fit the mobile browser screen.
Stars: ✭ 137 (+77.92%)
Mutual labels:  postcss, postcss-plugin
Rtlcss
Framework for transforming Cascading Style Sheets (CSS) from Left-To-Right (LTR) to Right-To-Left (RTL)
Stars: ✭ 1,363 (+1670.13%)
Mutual labels:  postcss, postcss-plugin
postcss-import-url
PostCSS plugin inlines remote files.
Stars: ✭ 47 (-38.96%)
Mutual labels:  postcss, postcss-plugin
Postcss Plugins
The "officially unofficial" consolidated list of PostCSS plugins in a ready-to-use package
Stars: ✭ 107 (+38.96%)
Mutual labels:  postcss, postcss-plugin
Postcss Spiffing
PostCSS plugin to use British English
Stars: ✭ 158 (+105.19%)
Mutual labels:  postcss, postcss-plugin
Postcss Triangle
PostCSS plugin to create a triangle.
Stars: ✭ 57 (-25.97%)
Mutual labels:  postcss, postcss-plugin
postcss-input-style
PostCSS plugin that adds new pseudo-elements for easily styling the inner elements of inputs
Stars: ✭ 16 (-79.22%)
Mutual labels:  postcss, postcss-plugin
postcss-clearfix
PostCSS plugin that adds a 'fix' argument to the 'clear' property
Stars: ✭ 47 (-38.96%)
Mutual labels:  postcss, postcss-plugin
Postcss Less
PostCSS Syntax for parsing LESS
Stars: ✭ 93 (+20.78%)
Mutual labels:  postcss, postcss-plugin
postcss-critical-css
PostCSS plugin to define and output critical CSS using custom atRules, and/or custom CSS properties. Critical CSS may be output to one or more files, as defined within the plugin options or within the CSS.
Stars: ✭ 84 (+9.09%)
Mutual labels:  postcss, postcss-plugin
Postcss Prefix Selector
Prefix all CSS rules with a selector
Stars: ✭ 75 (-2.6%)
Mutual labels:  postcss, postcss-plugin
Container Query
A PostCSS plugin and Javascript runtime combination, which allows you to write container queries in your CSS the same way you would write media queries.
Stars: ✭ 119 (+54.55%)
Mutual labels:  postcss, postcss-plugin
Postcss Nested Props
PostCSS plugin to unwrap nested properties.
Stars: ✭ 58 (-24.68%)
Mutual labels:  postcss, postcss-plugin
Postcss Rtl
PostCSS plugin for RTL-adaptivity
Stars: ✭ 143 (+85.71%)
Mutual labels:  postcss, postcss-plugin
Postcss Alias
PostCSS plugin that allows you to create aliases for CSS properties
Stars: ✭ 47 (-38.96%)
Mutual labels:  postcss, postcss-plugin
Postcss Import
PostCSS plugin to inline @import rules content
Stars: ✭ 1,048 (+1261.04%)
Mutual labels:  postcss, postcss-plugin
postcss-trash-killer
It is a postcss plugin which wil be remove all unused css
Stars: ✭ 20 (-74.03%)
Mutual labels:  postcss, postcss-plugin
postcss-center
PostCSS plugin to center elements.
Stars: ✭ 44 (-42.86%)
Mutual labels:  postcss, postcss-plugin

Build status

A PostCSS plugin to replace class names based on a customizable renaming scheme.

Usage

postcss-rename makes it possible to rename CSS class names in the generated stylesheet, which helps reduce the size of the CSS that is sent down to your users. It's designed to be used along with a plugin for a build system like Webpack that can rewrite HTML templates and/or references in JS. If you write such a plugin, let us know and we'll link it here!

Options

strategy

The renaming strategy to use:

  • "none": Don't change names at all. This is the default strategy.

  • "debug": Add an underscore at the end of each name. This is useful for keeping classes readable during debugging while still verifying that your templates and JavaScript aren't accidentally using non-renamed classes.

  • "minimal": Use the shortest possible names, in order of appearance: the first class is renamed to .a, the second to .b, and so on.

This can also be a function that takes a CSS name (the full name in by-whole mode and the part in by-part mode) and returns its renamed value.

by

Whether to rename in "by-whole mode" or "by-part mode".

  • "whole": Rename the entire name at once, so for example .tall-image might become .a. This is the default mode.

  • "part": Rename each hyphenated section of a name separately, so for example .tall-image might become .a-b.

prefix

A string prefix to add before every renamed class. This applies even if strategy is set to none.

In by-part mode, the prefix is applied to the entire class, but it isn't included in the output map.

except

An array (or other Iterable) of names that shouldn't be renamed.

ids

Whether to rename ID selectors as well as class selectors. Defaults to false.

outputMapCallback

A callback that's passed a map from original class names to their renamed equivalents, so that an HTML template or JS class references can also be renamed.

In by-part mode, this contains separate entries for each part of a class name. It doesn't contain any names that weren't renamed because of except.

Disclaimer: This is not an officially supported Google product.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].