-
-
Notifications
You must be signed in to change notification settings - Fork 76
postcss-gamut-mapping #1144
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
Merged
romainmenke
merged 17 commits into
main
from
progressive-color-gamut--practical-dodo-be5d547194
Oct 9, 2023
Merged
postcss-gamut-mapping #1144
romainmenke
merged 17 commits into
main
from
progressive-color-gamut--practical-dodo-be5d547194
Oct 9, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ut--practical-dodo-be5d547194
Antonio-Laguna
approved these changes
Oct 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romainmenke this looks great to me! Left a few minor questions but great to go!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
common-tools
plugin-packs/postcss-preset-env
plugins/postcss-color-function
plugins/postcss-color-functional-notation
plugins/postcss-double-position-gradients
plugins/postcss-gamut-mapping
plugins/postcss-gradients-interpolation-method
plugins/postcss-ic-unit
plugins/postcss-lab-function
plugins/postcss-oklab-function
plugins/postcss-progressive-custom-properties
plugins/postcss-relative-color-syntax
plugins/postcss-slow-plugins
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes : #1049
This does not "fix" massively out of gamut source colors so that they fit within
display-p3
orrec2020
. Only a singlesrgb
fallback is provided.Providing fallbacks for each wide gamut option would be slow and would needlessly bloat the output.
I am making the assumption that authors have the tools to choose and write colors that fit within either
display-p3
orrec2020
and that it is sufficient to provide ansrgb
fallback so that clipping is avoided. Clipping is the most harmful effect as it radically alters the color, away from the intention of the author.I don't think we need to provide a tool to enforce that wide gamut colors are real colors or that these fit within
rec2020
. Linters are better suited to that specific task.rec2020
is currently the widest gamut expected to be supported by displays. Authoring colors that do not fit withinrec2020
doesn't make sense today. The chance that hardware beyondrec2020
will become wide spread before browsers ship gamut mapping is small. If that happens we can adjust how this plugin works.This also better integrates
postcss-progressive-custom-properties
intopostcss-preset-env
.It is now part of the determined plugin order.
There will be some duplication in the output if a source requires many transforms.
The current form is the best balance between duplicate/redundant output and complexity in multiple plugins.
The only way to reduce duplication further is by bringing both gamut mapping fallbacks and progressive props to each and every plugin that might be related to colors. I don't see the point in doing that. A little bit of duplication is short term cost, eventually users will require fewer fallbacks.