Replies: 2 comments
-
We will continue this discussion when @mimarz is back from vacation on 30 august. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Material-ui during their rebranding to Mui explained why they went from "css classes" to using emotion ( css in js). Might be worth checking out why. https://mui.com/blog/mui-core-v5/#improved-customizability |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Test using pure css (css variables, with css tokens and css classes) for styling components in
eds-core-react
, instead of todays css in javascript withstyled-components
. Testing withButton
component.Approaches:
1 "Pure CSS"
2 "CSS in Javascript"
3 Hybrid
Verdict:
TDLR; It depends, both approaches has pros & cons. I don't feel one approach is a clear winner as both have limitation or weaknesses that you need workarounds.
Summary:
1. Pure CSS
PRO's:
styled-components
Themeprovider
andstyled-components
that needs to be learned.Middle:
CON's:
Button
; "contained + secondary" vs. "outlined + secondary"2. CSS in javascript
PRO's:
styled-components
does post-processing and autoprefixing for usMiddle:
CON's:
styled-components
3. Hybrid (NOT TESTED)
Using todays token structure we could introduce a the component css-variables (as done in pure-css example) and just override their values the same way we do in pure-css but still using styled components and js tokens.
Notes:
Beta Was this translation helpful? Give feedback.
All reactions