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

STRWEB-103 Refactor away from PostCSS Color Function #133

Merged
merged 2 commits into from
Dec 7, 2023
Merged

Conversation

JohnC-80
Copy link
Contributor

@JohnC-80 JohnC-80 commented Nov 30, 2023

https://issues.folio.org/browse/STRWEB-103

Corresponds with folio-org/stripes-components#2176

For a long time, we've used color() via postcss-color-function to blend colors. It was part of CSS-color-module 4 for a while, but then was renamed and eventually removed due to conflicts and lack of predictability with existing CSS color models. Standards eventually suggested their own color() function that did something completely different from what we were doing and simply used it as a means to switch color models. With the dependency aging (it was abandoned and forked by us at one point just to keep its dependencies updated) We need to take a different direction and find a better-supported way to do blends and adjustment... enter CSS-color-module 5's relative-color syntax.

We're adding a plugin for this here, but it's only a polyfill for lack of complete browser support.
The feature added by postcss-relative-color-syntax are available in Chrome and Edge - and hopefully soon-to-be-actualized in Firefox and Safari (TP).

With it we can do relative color adjustements like brightening, darkening, alpha adjustment, etc. We use this to replace the blend() functionality that we had in the non-spec plugin postcss-color-function.

Adds and employs the @csstools/postcss-relative-color-syntax plugin.

Copy link

github-actions bot commented Nov 30, 2023

Jest Unit Test Statistics

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit 09e29f1. ± Comparison against base commit 6a08438.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 30, 2023

BigTest Unit Test Statistics

73 tests  ±0   73 ✔️ ±0   0s ⏱️ ±0s
39 suites ±0     0 💤 ±0 
  1 files   ±0     0 ±0 

Results for commit 09e29f1. ± Comparison against base commit 6a08438.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@mkuklis mkuklis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@JohnC-80 JohnC-80 changed the title Refactor away from PostCSS Color Function STRWEB-103 Refactor away from PostCSS Color Function Dec 6, 2023
Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please add a note to the CHANGELOG. In the PR description/commit it would be useful to add a snippet of the context from folio-org/stripes-components/pull/2176 to explain why we need this dependency.

@JohnC-80 JohnC-80 merged commit be399f9 into master Dec 7, 2023
5 checks passed
@zburke zburke deleted the STRWEB-103 branch December 12, 2023 03:25
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

Successfully merging this pull request may close these issues.

3 participants