Skip to content

Commit

Permalink
temp fix for float values for <time> units (#120)
Browse files Browse the repository at this point in the history
* temp fix for float values for <time> units

* fix tests

* rm snapshots, need to dig in why it does not work across node versions
  • Loading branch information
bartveneman authored Mar 19, 2019
1 parent 7852180 commit c7dab3f
Show file tree
Hide file tree
Showing 5 changed files with 1,843 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/analyzer/values/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ const uniquer = require('../../utils/uniquer')
function extractColorsFromDeclaration(declaration) {
const colors = []

parse(declaration.value, {loose: true}).walk(node => {
if (node.isColor) {
return colors.push(node)
}
})
// Temporary try-catch until https://github.com/shellscape/postcss-values-parser/issues/76 is fixed
try {
parse(declaration.value, {loose: true}).walk(node => {
if (node.isColor) {
return colors.push(node)
}
})
} catch (error) {}

if (colors.length > 0) {
declaration.colors = colors.map(color => color.toString().trim())
Expand Down
1,564 changes: 1,564 additions & 0 deletions test/smoke/css-tricks-20190319.css

Large diffs are not rendered by default.

Loading

0 comments on commit c7dab3f

Please # to comment.