Skip to content
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

parse error when blend with hsl() #24

Open
FourwingsY opened this issue Sep 2, 2016 · 6 comments
Open

parse error when blend with hsl() #24

FourwingsY opened this issue Sep 2, 2016 · 6 comments

Comments

@FourwingsY
Copy link

.test {
  color: color(hsl(210, 10%, 85%) blend(hsl(330, 50%, 70%) 50%));
}

Error message says: Unable to parse color from string "hsl(330,"
can get the bug here too: http://cssnext.io/playground/

@magicznyleszek
Copy link

magicznyleszek commented Mar 31, 2017

I also have this problem (see MoOx/postcss-cssnext#363). It seems that the blend function only works with simple color names (like red or rebeccapurple) and # but doesn't with rgb() or hsl()

@kopax
Copy link

kopax commented Sep 26, 2017

I also hit the same issue.

@benweiser
Copy link

Same issue with Sass's lighten/darken functions

@Semigradsky
Copy link

#23 the same

@feimosi
Copy link

feimosi commented Apr 12, 2018

Is there any way to silence these messages? The function works correctly for me, just throws that error.

@mooreInteractive
Copy link

mooreInteractive commented Jun 20, 2018

If anyone else finds this thread, I fixed it by re-ordering the postcss plugins(I'm using webpack setup).

For this to work and interpret a variable, it needs to come after the plugin that handles variables.

For my setup:
Didn't work, showed "Unable to parse color from string" error:

plugins: () => [
    ...
    require('postcss-css-color-function'),
    require('postcss-mixins'),
    require('postcss-nested'),
    require('postcss-simple-vars'),
    require('postcss-calc'),
    ...
]

WORKS, no error:

plugins: () => [
    ...
    require('postcss-mixins'),
    require('postcss-nested'),
    require('postcss-simple-vars'),
    require('postcss-css-color-function'),
    require('postcss-calc'),
    ...
]

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

7 participants