postcss-normalize-string

Normalize wrapping quotes for CSS string literals.

MIT 40 个版本
安装
npm install postcss-normalize-string
yarn add postcss-normalize-string
pnpm add postcss-normalize-string
bun add postcss-normalize-string
README

postcss-normalize-string

Normalize strings with PostCSS.

Install

With npm do:

npm install postcss-normalize-string --save

Example

Input

p:after{ content: '\\'string\\' is intact' }

Output

p:after{ content:"'string' is intact" }

Usage

See the PostCSS documentation for examples for your environment.

API

normalize([options])

options

preferredQuote

Type: string Default: double

Sets what type of quote to prefer. Possible values are single and double.

var css = 'p:after{content:""}';
console.log(postcss(normalize({preferredQuote: 'single'})).process(css).css);
//=> p:after{content:''}

Contributors

See CONTRIBUTORS.md.

License

MIT © Ben Briggs

版本列表
8.0.1 2026-06-11
8.0.0 2026-05-06
7.0.3 2026-05-02
7.0.2 2026-04-20
7.0.1 2025-05-06
7.0.0 2024-04-24
6.0.2 2024-03-06
6.0.1 2023-12-14
6.0.0 2023-03-27
5.1.0 2022-03-01
5.0.4 2022-02-07
5.0.3 2022-01-23
5.0.2 2022-01-07
5.0.1 2021-05-19
5.0.0-rc.2 2021-03-15
5.0.0-rc.1 2021-03-05
5.0.0-rc.0 2021-02-19
5.0.0 2021-04-10
4.0.2 2019-02-12
4.0.1 2018-09-24
4.0.0-rc.2 2017-08-06
4.0.0-rc.0 2017-06-01
4.0.0 2018-07-04