Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.
This repository was archived by the owner on Nov 1, 2022. It is now read-only.

How to not break selector specificity ? #1

@sylvainpolletvillard

Description

@sylvainpolletvillard

Replacing selectors with classnames change the selector specificity and may break intended priority overrides.

Example:

Input:

<ul>
<li>should be green</li>
<li>should be red</li>
</ul>
ul > li:first-child {
	background-color: green;
}

ul > li {
	background-color: red;
}

Output:

<ul>
<li class="_a9c6b _55267">should be green</li> <--- becomes red
<li class="_55267">should be red</li>
</ul>
._a9c6b {
	background-color: green;
}

._55267 {
	background-color: red;
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions