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

HSL and HWB non-legacy CSS (space format) do not need to be forced to percentage output #371

Open
facelessuser opened this issue Oct 19, 2023 · 1 comment
Labels
skip-triage Tells bot to not tag a new issue with 'triage'. T: enhancement Enhancement.

Comments

@facelessuser
Copy link
Owner

The CSS spec does not require the new style formats for HSL and HWB to be forced to percentage output, they can also just take plain numbers for non-hue components. As a matter of fact, HWB does not even have a legacy, comma format.

Browsers do not currently follow the spec in this regard and still only recognize these colors with percentages for their non-hue components (excluding alpha).

Currently, we default to using percentages for these two spaces in the new style format. At some point, for consistency, we need to drop this behavior and match what we do with Lab, LCh, etc. For now, we are leaving them as is to avoid confusion for people coming from the browser world to ColorAide. Once browsers catch up to the current CSS specification, we can adjust behavior to match.

@facelessuser facelessuser added T: enhancement Enhancement. skip-triage Tells bot to not tag a new issue with 'triage'. labels Oct 19, 2023
@facelessuser facelessuser changed the title HSL and HWB non-legacy CSS (comma format) do not need to be forced to percentage output HSL and HWB non-legacy CSS (space format) do not need to be forced to percentage output Feb 5, 2024
@facelessuser
Copy link
Owner Author

Chrome finally supports HSL and HWB without percents. Firefox and Safari are currently lagging in support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-triage Tells bot to not tag a new issue with 'triage'. T: enhancement Enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant