Skip to content
A Lightning Design System CSS class prefix customizer for PostCSS
Branch: master
Clone or download
Pull request Compare This branch is 15 commits ahead, 1 commit behind thompsongl:master.
Kaelig Deloumeau-Prigent
Kaelig Deloumeau-Prigent Rename RELEASENOTES.md to CHANGELOG.md
Latest commit cc50fd3 Mar 8, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
.travis.yml
CHANGELOG.md Rename RELEASENOTES.md to CHANGELOG.md Mar 9, 2017
CONTRIBUTING.md Update CONTRIBUTING.md Feb 16, 2017
LICENSE Initial release Sep 14, 2016
README.md
index.js
package.json

README.md

postcss-class-prefix Build Status

A PostCSS plugin to prefix/namespace slds- classes in the Lightning Design System's CSS.

This avoids collisions with other versions of the Salesforce Lightning Design System by prefixing your class names with a custom namespace.

Example input

.slds-classname { /* ... */ }

Example output sldsPrefix('custom-prefix')

.custom-prefix-classname { /* ... */ }

Installation

npm install postcss-slds-prefix

Usage

var fs         = require('fs');
var postcss    = require('postcss');
var sldsPrefix = require('postcss-slds-prefix');

var css = fs.readFileSync('css/my-file.css', 'utf8').toString();
var out = postcss()
            .use(sldsPrefix('my-prefix'))
            .process(css);

License

MIT

Acknowledgements

You can’t perform that action at this time.