Skip to content

Conversation

@shawnbot
Copy link
Contributor

This is a proof of concept that introduces a theme abstraction to Primer CSS. The gist of it is:

  • There is a :root block which defines CSS custom properties for many (not all!) of our SCSS variables.
  • In SCSS, the global variables for each of these is overridden to var(--<name>) so that references in our source use the runtime value (the CSS custom property).

I'm going to see if I can put together a demo of this once it's deployed. 🤞

@vercel
Copy link

vercel bot commented Nov 15, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/primer/primer-css/15arnvhsc
🌍 Preview: https://primer-css-git-custom-properties.primer.now.sh

@shawnbot
Copy link
Contributor Author

Here's a CodePen that illustrates how this might work. One thing to notice is that we can reference the entire color system using custom variables now, as in var(--gray-9). ✨

@simurai simurai changed the base branch from release-14.0.0 to master November 26, 2019 07:37
@vercel vercel bot temporarily deployed to Preview December 30, 2019 06:32 Inactive
Base automatically changed from master to main March 26, 2021 00:50
@jonrohan jonrohan closed this Mar 26, 2021
@jonrohan jonrohan deleted the custom-properties branch March 26, 2021 16:50
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.

4 participants