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

Wrong output when using the * operator and <percentage> #46

Open
nia1048596 opened this issue Nov 2, 2017 · 0 comments
Open

Wrong output when using the * operator and <percentage> #46

nia1048596 opened this issue Nov 2, 2017 · 0 comments
Labels

Comments

@nia1048596
Copy link

nia1048596 commented Nov 2, 2017

The color hsl(0, 0%, 10%) with lightness multiplied by 5% should be nearly black, but the output seems to be hsl(0, 0%, 10% * 5) == rgb(128, 128, 128) rather than hsl(0, 0%, 10% * 5%). If use 0.05 instead the output is correct.

test.css:

.test1 {
    background-color: color(hsl(0, 0%, 10%) lightness(* 5%));
}
.test2 {
    background-color: color(hsl(0, 0%, 10%) lightness(* 0.05));
}

postcss.config.js:

module.exports = {
    plugins: {
        'postcss-color-function': {},
    },
}

Output:

nia@nia-PC [~/temp/test] $ ./node_modules/.bin/postcss test.css
✔ Finished test.css (17 ms)
.test1 {
    background-color: rgb(128, 128, 128);
}
.test2 {
    background-color: rgb(3, 3, 3);
}
nia@nia-PC [~/temp/test] $

The version is 4.0.0

nia@nia-PC [~/temp/test] $ npm list postcss-color-function
/home/nia/temp/test
└── [email protected]

Since the spec says we should use <percentage>, I think this is a bug.

@Semigradsky Semigradsky added the bug label Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants