Skip to content

isColor does not detect capitalized RGB(A) and HSL(A) functions #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bartveneman opened this issue Mar 4, 2019 · 0 comments
Closed

Comments

@bartveneman
Copy link

  • Webpack Version: N/A
  • Operating System (or Browser): Mac OS 10.14.3
  • Node Version: 10.15.2
  • postcss-values-parser Version: 3.0.0 (🎉)

How Do We Reproduce?

const {parse} = require('postcss-values-parser')

const fixtures = [
  'RGBA(100, 200, 11, .5)',
  'RGB(100, 200, 11)',
  'Hsl(20, 10%, 5%)',
  'HSLA(20, 10%, 5%, 0.5)'
]

fixtures.forEach(color => {
  parse(color, {loose: true}).walk(node => {
    console.log(node.isColor)
  })
})

Expected Behavior

Expected isColor to be true for all of these cases

Actual Behavior

isColor is false for all of these cases

Related issues and code

I hope I've covered most cases by now 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant