cssesc(1)

NAME
cssesc - escape text for use in CSS string literals or identifiers

SYNOPSIS
cssesc [-i | --identifier string]
[-s | --single-quotes string]
[-d | --double-quotes string]
[-w | --wrap string]
[-e | --escape-everything string]
[-v | --version]
[-h | --help]

DESCRIPTION
cssesc escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output.

OPTIONS

-s, --single-quotes
Escape any occurences of ' in the input string as \', so that the output can be used in a CSS string literal wrapped in single quotes.

-d, --double-quotes
Escape any occurences of " in the input string as \", so that the output can be used in a CSS string literal wrapped in double quotes.

-w, --wrap
Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the -s | --single-quotes or -d | --double-quotes settings.

-e, --escape-everything
Escape all the symbols in the output, even printable ASCII symbols.

-v, --version
Print cssesc's version.

-h, --help
Show the help screen.

EXIT STATUS
The cssesc utility exits with one of the following values:

0   cssesc successfully escaped the given text and printed the result.
1   cssesc wasn't instructed to escape anything (for example, the --help flag was set); or, an error occurred.

EXAMPLES

cssesc 'foo bar baz'
Print an escaped version of the given text.

echo 'foo bar baz' | cssesc
Print an escaped version of the text that gets piped in.

BUGS
cssesc's bug tracker is located at <https://github.com/mathiasbynens/cssesc/issues>.

AUTHOR
Mathias Bynens <http://mathiasbynens.be/>

WWW
<http://mths.be/cssesc>