/* variables specific to current element */ $radio-dot-dimensions: $circle-dimensions-global; $radio-dot-inner-circle-dimensions: map-deep-get($token-sizes-unit-map, "16"); .#{$namespace}radioDot { /* Save root element context for easy access if nesting is needed */ $self: &; /* properties of current element + media queries */ position: relative; @include custom-prop-fallback("background-color","comp-radio-background-color"); border: $border-width*2 solid; @include custom-prop-fallback("border-color", "comp-radio-border-color"); cursor: pointer; width: $radio-dot-dimensions; height: $radio-dot-dimensions; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: map-deep-get($token-radius-map, "circle"); /* Pseudo Elements */ &::before { content: ""; opacity: 0; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); @include custom-prop-fallback("background-color","comp-radio-checked-dot-background-color"); width: $radio-dot-inner-circle-dimensions; height: $radio-dot-inner-circle-dimensions; border-radius: inherit; } &::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 */ // radioDot__childElement &__childElement { // follows same logic as parent } /* modifiers */ // disabled &.-isDisabled, INPUT[disabled] + &, INPUT:disabled + & { @include radioInputDisabled(); } &.-isDisabled:checked, INPUT[disabled]:checked + &, INPUT:disabled:checked + & { @include radioInputDisabledChecked(); } // radioDot -active INPUT:checked + &, &.-active { @include radioInputChecked(); } &.-isLoading { &::before { content: ""; position: absolute; top: -$border-width*2; left: -$border-width*2; opacity: 1; transform: none; background-color: transparent; width: $radio-dot-dimensions; height: $radio-dot-dimensions; border: $border-width*3 solid; @include radioInputLoading(); animation: rotation 1s linear infinite; border-radius: inherit; } } /* random parent element */ /* * * Syntax : .randomParentElt & {} * */ /* Pseudo Classes */ &:hover { @media (hover: hover) { @include radioInputHovered(); } } INPUT:focus-visible + & { @include radioInputFocused(); } &:active { } &:focus, &:active { } }