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

Provide consistent class names for themes. #149

Closed
insertish opened this issue Aug 28, 2021 · 3 comments
Closed

Provide consistent class names for themes. #149

insertish opened this issue Aug 28, 2021 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@insertish
Copy link
Member

Class names are currently generated by:

  • styled-components, which are super inconsistent
  • Vite which should stay fairly consistent, but unsure of how reliable they are

Need a nice way to provide consistent class names to people who want to theme the app.

@insertish insertish added enhancement New feature or request help wanted Extra attention is needed labels Aug 28, 2021
@Bawbby
Copy link
Contributor

Bawbby commented Aug 29, 2021

No idea what I'm doing but I looked into doing consistent class names.

  • Vite uses postcss-modules for the CSS module class names. You can configure those with css.modules.generatedScopeName
  • For Styled components it looks impossible. Styled components generate random class names to prevent name clashing.

Let me know if I got anything wrong though.

@philip-peterson
Copy link

Styled-components provides support for themeing -- https://styled-components.com/docs/api#themeprovider it's just a little more specific than creating a raw stylesheet.

@insertish
Copy link
Member Author

insertish commented Jan 14, 2022

Unintentionally fixed this in 3fd56e4.

image

(you can match against the start of the class attribute without much hassle)
(also we are migrating from scss to sc, so all the other classes will eventually follow suit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
No open projects
Release Tracker
Free Issues
Development

No branches or pull requests

3 participants