used-styles icon indicating copy to clipboard operation
used-styles copied to clipboard

Styles priority

Open KoderFPV opened this issue 4 years ago • 1 comments

Hi, I have weird problem. image

As you can see on the image, selected div has two classes:

container Products__mobilePadding__27tZs

.container class has

padding-right: 1.875rem; padding-left: 1.875rem;

And Products__mobilePadding__27tZs class has

padding: 0 1rem;

Why second in order class with a single padding definition does not exclude container class dual padding definition and their have a higher priority?

Thanks for help!

KoderFPV avatar Sep 24 '20 12:09 KoderFPV

The order of a class in className does not matter - only the order of a rule in the result css file matters. As I could see from your screenshot - .container has a bigger priority (defined later) on index.scss as well.

theKashey avatar Sep 24 '20 23:09 theKashey