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

[discussion] CSS modules #2439

Closed
amass01 opened this issue Mar 7, 2020 · 4 comments · Fixed by #3330
Closed

[discussion] CSS modules #2439

amass01 opened this issue Mar 7, 2020 · 4 comments · Fixed by #3330
Assignees

Comments

@amass01
Copy link
Member

amass01 commented Mar 7, 2020

CSS modules are available and used in modern react apps in order to achieve styling encapsulation.

CSS modules will help us maintain very small styling files - where each component gets it's dedicated module/file which ensure no styling clashes cross the app which means no need to come up with very long unmaintainable class names everywhere.

@matheusd
Copy link
Member

If we're going this route, it's probably best to do a small component first so we can check out what the code layout would look like.

@amass01
Copy link
Member Author

amass01 commented Mar 11, 2020

@matheusd agreed - I'll be doing some POC work and update small part for #2438 per @alexlyp request, I thought maybe I could also migrate the styling to use CSS modules on the way.

what do you think ?

@matheusd
Copy link
Member

Yeah, a poc for both is the way to go.

@amass01
Copy link
Member Author

amass01 commented Jun 4, 2020

We have also stuff like:

 const className = [
      "trezor-passphrase-modal",
      this.props.isGetStarted ? "get-started" : ""
    ].join(" ");

Which can be replaced with: classNames(classNames(class1 , conditioned class2, ...)) and can be done while migrating .less files to css modules

This was referenced Jan 23, 2021
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 a pull request may close this issue.

2 participants