Last active
September 14, 2021 03:33
-
-
Save giovannif23/c7db39238aed5c0cddcf276cd25086cf to your computer and use it in GitHub Desktop.
Sass naming style options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ELEMENT NAMING | |
*/ | |
// NAMING STYLE V1 (true BEM) | |
.k-input { | |
@apply border-gray-200; | |
@apply rounded; | |
// ELEMENTS .k-input__icon | |
&__icon { | |
@apply color-blue; | |
} | |
// MODIFIERS .k-input.k-input--error | |
&--error { | |
@apply color-red; | |
} | |
} | |
// NAMING STYLE V2 (shortened) | |
.k-input { | |
@apply border-gray-200; | |
@apply rounded; | |
// ELEMENTS .k-input_icon | |
&_icon { | |
@apply color-blue; | |
} | |
// MODIFIERS .k-input.k-input-error | |
&-error { | |
@apply color-red; | |
} | |
} | |
// NAMING STYLE V3 (simplified modifier class) | |
.k-input { | |
@apply border-gray-200; | |
@apply rounded; | |
// ELEMENTS .k-input_icon | |
&_icon { | |
@apply color-blue; | |
} | |
// MODIFIERS .k-input.-error | |
.-error { | |
@apply color-red; | |
} | |
} | |
/** | |
* MODIFIER NAMING | |
*/ | |
.k-input { | |
@apply border-gray-200; | |
@apply rounded; | |
// MODIFIERS V1 k-input.-error | |
.-error { | |
@apply color-red; | |
} | |
.-open { | |
@apply block; | |
} | |
// MODIFIERS V2 k-input.has-error | |
.has-error { | |
@apply color-red; | |
} | |
.is-open { | |
@apply block; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment