N°3685 Optimize CSS size: .ibo-button is extended at multiple places, reducing its use in loops when possible greatly improves compiled selectors

This commit is contained in:
Stephen Abello
2021-09-13 16:34:56 +02:00
committed by Molkobain
parent 61f3d3aeda
commit 1fb2ff355d
2 changed files with 5 additions and 3 deletions

View File

@@ -48,8 +48,10 @@ $ibo-button-group--elements-separator--border-left: 1px solid transparent !defau
border-left: $ibo-button-group--elements-separator--border-left;
}
/* Note: Selector cannot be simplified in the one above as the "::before" must be after the different classes */
.ibo-button + .ibo-button {
/* Note: Selector cannot be simplified in the one above as the "::before" must be after the different classes.
* A more precise selector could be .ibo-button + .ibo-button, however .ibo-button is extended by multiple element and in a multiple loop it creates heavy selectors.
*/
> * + * {
@each $sType, $aColors in $ibo-button-colors {
@each $sColor, $aPseudoclasses in $aColors {
@each $sPseudoclass, $aAttributes in $aPseudoclasses {

View File

@@ -471,7 +471,7 @@ $ibo-button-colors: (
white-space: nowrap; /* To force sub elements to be on 1 line */
@extend %ibo-font-ral-sembol-100;
& ~ .ibo-button {
& + .ibo-button {
margin-left: $ibo-button--sibling-spacing;
}