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

Internal: Add CSS variables CI checks #1041

Merged
merged 1 commit into from Jul 10, 2020

Conversation

christianvuerings
Copy link
Contributor

@christianvuerings christianvuerings commented Jul 9, 2020

Improves safety of our CSS variables.

We introduced a split CSS bundle for legacy and future CSS in #963 but this resulted in potential breakages:

await duplicateVariablesDifferentValues();
await noVarInLegacyCSS();

Duplicate Variables with Different Values

We already saw this issue in #971 where the font-size variables for Text and Heading got overridden resulting in heading sizes to be the same as text sizes

image

Test: change a color that appears multiple times in 1 location:

--gestalt-colorGray100: #efefef;

to

--gestalt-colorGray100: #efefed;

Screen Shot 2020-07-09 at 4 19 04 PM

CSS Variables in legacy CSS

This will break in IE11 since the compiled CSS will still contain the var(). We can only use :root for now so it does get replaced in the legacy build.

Test: Add this to any file CSS file

.textFieldTemp {
  --gestalt-colorGrad: #111;

  color: var(--gestalt-colorGrad);
}

Screen Shot 2020-07-09 at 4 31 43 PM

@christianvuerings christianvuerings requested a review from a team as a code owner July 9, 2020 23:36
@netlify
Copy link

netlify bot commented Jul 9, 2020

Deploy preview for gestalt ready!

Built with commit 45718b2

https://deploy-preview-1041--gestalt.netlify.app

@christianvuerings christianvuerings added the minor release Minor release label Jul 9, 2020
@christianvuerings christianvuerings changed the title Internal: Add CSS variables checks Internal: Add CSS variables CI checks Jul 9, 2020
scripts/cssValidate.js Outdated Show resolved Hide resolved
@mergify mergify bot merged commit b12aedc into pinterest:master Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor release Minor release
Projects
None yet
2 participants