theKashey / used-styles

📝All the critical styles you've used to render a page.
MIT License
137 stars 9 forks source link

Styles priority #25

Open KoderFPV opened 3 years ago

KoderFPV commented 3 years ago

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 ProductsmobilePadding27tZs 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!

theKashey commented 3 years ago

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.