Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Use shortest frequency unit #81

Merged
merged 1 commit into from
Jun 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions index.js
Expand Up @@ -197,6 +197,9 @@ var wringValue = function (prop, value) {
).replace(
re.angle,
toShortestAngle
).replace(
re.freqEndsWithThreeZeros,
"$1$2kHz"
).replace(
re.urlFunction,
unquoteURL
Expand Down
3 changes: 3 additions & 0 deletions lib/regexp.js
Expand Up @@ -29,6 +29,9 @@ re.descriptorFontFace = /^font-(style|stretch|variant|feature-settings)$/i;
// \(, \)
re.escapedBraces = /\\([()])/g;

// 1000Hz
re.freqEndsWithThreeZeros = /(^|\s|\(|,)(\d+)000Hz/gi;

// /**/, /*\**/
re.hackPropComment = /\/\*(\\\*)?\*\//;

Expand Down
1 change: 1 addition & 0 deletions test/expected/freq.css
@@ -0,0 +1 @@
.foo{pitch:12kHz}
3 changes: 3 additions & 0 deletions test/fixtures/freq.css
@@ -0,0 +1,3 @@
.foo {
pitch: 12000Hz;
}