node package manager

css-safe

Make strings safe for CSS.

css-safe

Make string safe for CSS.

Install

via npm:

$ npm install --save css-safe

Supports Node, AMD, browser global via UMD.

Use

var cssSafe = require('css-safe');
 
var safe = cssSafe('Red, and blue.');
// 'red__002c-and-blue__0021'