Q
Q
qfrontend2019-02-25 20:03:13
React
qfrontend, 2019-02-25 20:03:13

What is the best way to style CSS Modules or Styled Components?

Greetings)
What is the best way to style CSS Modules or Styled Components? What is more relevant at the moment? How do you write styles?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
G
grinat, 2019-02-25
@grinat

This and that is disgusting, thanks to the usual css, you can really easily and quickly style pages. And this is all tracing paper from desktop applications, and their styling has always been a nightmare, an attempt to add some kind of rounding turned into a fight with a bunch of xml'ek. Now, when the desktop is almost dead, as everyone is moving en masse to the web, people are trying to drag the worst things from there.

M
mr jeery, 2019-02-25
@jeerjmin

I like to use CSS Modules. You can define styles with the same name in each component, for example "container", and not "appbar-container", "appbar2-container" etc. and not worry that it occurs in another component.

I
itsjustmypage, 2019-02-25
@itsjustmypage

While you're asking here, they'll both be outdated, you'll have to rewrite.

T
taliano, 2019-02-25
@taliano

CSS-in-JS on the hype, and specifically styled-components, glamorous or aphrodite is already a matter of taste

S
SerzN1, 2019-03-09
@SerzN1

what gives one and the other?
CSSinJS - convenient theming, encapsulation
CSS Modules - encapsulation
of the minuses - CSSinJS approach is a kind of dubious code
actually we draw conclusions - it doesn't matter if you don't actively use theming

K
Klein Maximus, 2020-02-08
@kleinmaximus

On the current project we have CSS Modules, on the previous one we had styled-components. Both of these can be used. It's a matter of personal preference. But perhaps styled-components is more of a "React way" than CSS Modules.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question