/* variables specific to current element */ $checkbox-dot-dimensions: $checkbox-dot-dimensions-global; .#{$namespace}checkboxDot { /* Save root element context for easy access if nesting is needed */ $self: &; /* properties of current element + media queries */ border-width: $border-width*2; border-style: solid; width: $checkbox-dot-dimensions-global; height: $checkbox-dot-dimensions-global; @extend %checkboxDotShape; /* Pseudo Elements */ &::before { content: map-deep-get($token-icon-map, "checksmall"); font-size: map-deep-get($token-font-size-map,"body","xl"); opacity: 0; @include icon-base; } &::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 { @keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } } /* children - write selector in full in comments in order to facilitate search */ /* modifiers */ // checkboxDot -active INPUT:checked + &, &.-isActive { @include checkboxInputChecked(); } // disabled &.-isDisabled, INPUT[disabled] + &, INPUT:disabled + & { @include checkboxInputDisabled(); } &.-isDisabled:checked, INPUT[disabled]:checked + &, INPUT:disabled:checked + & { @include checkboxInputDisabledChecked(); } &.-isLoading { &::before { content: ""; position: absolute; top: -$border-width*2; left: -$border-width*2; opacity: 1; width: $checkbox-dot-dimensions-global; height: $checkbox-dot-dimensions-global; border: $border-width*3 solid; @include checkboxLoading(); animation: rotation 1s linear infinite; border-radius: inherit; } } /* random parent element */ /* * * Syntax : .randomParentElt & {} * */ .#{$namespace}showCustomIndicatorHover { &:hover & { @media (hover: hover) { @include checkboxHovered(); } } } /* Pseudo Classes */ &:hover { @media (hover: hover) { @include checkboxHovered(); } } INPUT:active + &, INPUT:focus-visible + & { @include checkboxFocused(); } &:active { } &:focus, &:active { } }