diff --git a/lib/nodes/Numeric.js b/lib/nodes/Numeric.js index ce7c4c0..5cf25a4 100644 --- a/lib/nodes/Numeric.js +++ b/lib/nodes/Numeric.js @@ -14,7 +14,7 @@ const { registerWalker } = require('../walker'); const Node = require('./Node'); -const unitRegex = /%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw$/i; +const unitRegex = /%|ch|cm|em|ex|in|mm|pc|pt|px|q|rem|vh|vmax|vmin|vw$/i; class Numeric extends Node { constructor(options = {}) { diff --git a/test/fixtures/numeric.js b/test/fixtures/numeric.js index 267b74f..cbedc06 100644 --- a/test/fixtures/numeric.js +++ b/test/fixtures/numeric.js @@ -22,6 +22,7 @@ module.exports = { '-2px', '-16px', '-16px -1px -1px -16px', + '10q', '1e10', '1E10', '1e-10', diff --git a/test/snapshots/numeric.test.js.md b/test/snapshots/numeric.test.js.md index 185310d..75986bf 100644 --- a/test/snapshots/numeric.test.js.md +++ b/test/snapshots/numeric.test.js.md @@ -69,7 +69,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '-.567800E-0012780em', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -375,7 +375,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '.1E+10', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -414,7 +414,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '.1E-10', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -505,6 +505,45 @@ Generated by [AVA](https://ava.li). }, ] +## 10q + +> Snapshot 1 + + '10q' + +> Snapshot 2 + + '10q' + +> Snapshot 3 + + [ + Numeric { + raws: { + after: '', + before: '', + }, + source: { + end: { + column: 1, + line: 1, + }, + input: Input { + css: '10q', + hasBOM: false, + id: '', + }, + start: { + column: 1, + line: 1, + }, + }, + type: 'numeric', + unit: 'q', + value: '10', + }, + ] + ## 1E+10 > Snapshot 1 @@ -531,7 +570,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '1E+10', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -570,7 +609,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '1E-10', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -609,7 +648,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '1E10', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -648,7 +687,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '1e+10', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -687,7 +726,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '1e-10', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -726,7 +765,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '1e10', hasBOM: false, - id: '', + id: '', }, start: { column: 1, diff --git a/test/snapshots/numeric.test.js.snap b/test/snapshots/numeric.test.js.snap index 0f0136b..26556f4 100644 Binary files a/test/snapshots/numeric.test.js.snap and b/test/snapshots/numeric.test.js.snap differ