Actionable variant gives the badge a border when selected.
<span class="sds-npsBadge -npsBadge3">3</span>
<span class="{{ namespace }}npsBadge{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}">{{ text }}</span>
/* variables specific to current element */
.#{$namespace}npsBadge {
/* Save root element context for easy access if nesting is needed */
$self: &;
/* properties of current element + media queries */
display: flex;
align-items: center;
justify-content: center;
@include spacer-component-inline(sm);
@include custom-prop-fallback("color", "comp-badge-energy-nps-light-text-color");
@include custom-prop-fallback("border-radius", "comp-badge-nps-dot-border-radius");
@include custom-prop-fallback("width", "comp-badge-nps-dot-width");
@include custom-prop-fallback("height", "comp-badge-nps-dot-height");
/* Pseudo Elements */
&::before {
}
&::after {
}
/*
Include elements that are linked to the current element but have to reside at the root level of the stylesheet
(e.g: keyframes)
*/
@at-root {
}
/* children - write selector in full in comments in order to facilitate search */
// energyBadge__childElement
/* modifiers */
$npsBadgeTotalRates: 10;
@for $i from 1 through $npsBadgeTotalRates {
$classname: camelize(nps-badge-#{$i});
&.-#{$classname} {
background-color: var(--comp-badge-nps-rate-#{$i}-dot-background-color);
@if $i >= 5 {
@include custom-prop-fallback("color", "comp-badge-energy-nps-dark-text-color",true,true);
}
@media (hover: hover) {
&:hover {
background-color: var(--comp-badge-nps-rate-#{$i}-hovered-dot-background-color);
@include custom-prop-fallback("color", "comp-badge-energy-nps-light-text-color",true,true);
}
}
}
}
@at-root BUTTON#{&},
input[type="checkbox"] + &,
input[type="radio"] + & {
cursor: pointer;
}
@at-root BUTTON#{&}:focus-visible,
input[type="checkbox"]:checked + &,
input[type="radio"]:checked + & {
outline: $border-width*2 solid !important;
outline-offset: $border-width*2 !important;
@include custom-prop-fallback("outline-color", "comp-badge-nps-selected-outline-border-color","true","true");
}
/* random parent element */
/*
*
* Syntax : .randomParentElt & {}
*
*/
/* Pseudo Classes */
&:hover {
@media (hover: hover) {
}
}
&:focus {
}
&:active {
}
&:focus,
&:active {
}
}