Problem Description
The resulting CSS code becomes quite large and might be possible to get further reduced.
Proposed Solution
As CSS Nesting is a thing for quite a while now and supported by all major browsers, we could as well transform the declarations to a nested @media or @supports declaration instead of duplicating the CSS rule with the same selector. This would further simplify the resulting CSS code.
CSS Example
Currently
.responsive {
width: 50%;
}
@media (max-width: 768px) {
.responsive {
width: 100%;
}
}
Optimized
.responsive {
width: 50%;
@media (max-width: 768px) {
width: 100%;
}
}
Alternatives Considered
No response
Impact Level
Medium - Would improve workflow
Breaking Change
Use Cases
No response
Additional Context
No response
Checklist
Problem Description
The resulting CSS code becomes quite large and might be possible to get further reduced.
Proposed Solution
As CSS Nesting is a thing for quite a while now and supported by all major browsers, we could as well transform the declarations to a nested
@mediaor@supportsdeclaration instead of duplicating the CSS rule with the same selector. This would further simplify the resulting CSS code.CSS Example
Currently
Optimized
Alternatives Considered
No response
Impact Level
Medium - Would improve workflow
Breaking Change
Use Cases
No response
Additional Context
No response
Checklist