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

junk: Scoped button CSS variables #5

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

creido-welly
Copy link
Contributor

@creido-welly creido-welly commented Jul 26, 2021

Context

Proof of concept for scoping of CSS variables i.e. not within a :root { } block.

The scoping demonstrated in this file provides very succinct and I would argue more readable code and results in far fewer variables. This works well when being consumed as a package. Further discovery work should be done to see how this could be optimised for theming.

Caveat

Scoped variables do not work well with CSS variable compiling using a Postcss plugin such as postcss-css-variables or postcss-custom-properties.

See below a summary of how CSS properties compile to hex values:

Works with :root variables Works with scoped variables
Main app Yes Yes
Package Yes Not reliable

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.

1 participant