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

using "in srgb" in a color-mix breaks stylus #1694

Closed
anom opened this issue Nov 8, 2023 · 1 comment
Closed

using "in srgb" in a color-mix breaks stylus #1694

anom opened this issue Nov 8, 2023 · 1 comment
Labels

Comments

@anom
Copy link

anom commented Nov 8, 2023

The following breaks Stylus:
background color-mix(in srgb, black 10%, white);

The in srgb is the issue, but this is correct usage.

@pabli24
Copy link
Contributor

pabli24 commented Nov 8, 2023

It's a stylus preprocessor bug that you can report here https://github.com/stylus/stylus

workarounds:
https://stylus-lang.com/docs/bifs.html#s-fmt

body {
	background: s("color-mix(in srgb, black 10%, white)");
	background: unquote("color-mix(in srgb, black 10%, white)");
}

https://stylus-lang.com/docs/literal.html

@css {
	body {
		background: color-mix(in srgb, black 10%, white);
	}
}

body {
	background: @css{color-mix(in srgb, black 10%, white)};
	background: color-mix(@css{in srgb, black 10%, white});
}

https://stylus-lang.com/docs/bifs.html#mix-color1-color2-amount

body {
	background: mix(black, white, 10%);
}

I would recommend to use less preprocessor instead as it's more up-to-date with new css features
and for new people, it is less confusing to use as it has better compatibility with normal css.

@tophf tophf added the external label Nov 9, 2023
@tophf tophf closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2023
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

3 participants