/* variables specific to current element */ $element-specific-variables: ""; .#{$namespace}range { /* are only defined without being declared anywhere because they are purely a JS hook */ --custom-range-progress-color: var(--comp-range-knob-background-color); --custom-range-track-color: var(--comp-range-background-color); /* Save root element context for easy access if nesting is needed */ $self: &; /* properties of current element + media queries */ /* 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 */ LABEL { margin-bottom: 0; } // range__header &__header { // follows same logic as parent display: flex; align-items: center; justify-content: space-between; margin-bottom: map-get($spacers, 4); font-weight: 600; } &__body { height: $custom-range-thumb-height; display: flex; align-items: center; position: relative; } &__indicator { position: absolute; top: -$custom-range-thumb-height*1.75; text-align: center; white-space: nowrap; @include custom-prop-fallback("color", "sys-color-text-primary-muted"); SPAN { @include custom-prop-fallback("color", "sys-color-text-primary-contrast"); } } &__value { SPAN { margin-right: map-get($spacers, 4); } } &__footer { display: flex; justify-content: space-between; margin-top: map-deep-get($token-spacer-stack-max-map, "xs"); @include custom-prop-fallback("color", "sys-color-text-primary-muted"); @extend %textHelper; } &__rates { margin-top: map-deep-get($token-spacer-stack-max-map, "sm"); } INPUT[type="range"] { &[disabled] { --custom-range-progress-color: var(--sys-color-background-neutral-100); --custom-range-track-color: var(--comp-range-disabled-background-color); ~ #{$self}__indicator { @include custom-prop-fallback("color", "sys-color-text-neutral-vivid"); SPAN { @include custom-prop-fallback("color", "sys-color-text-neutral-vivid"); } } } } /* modifiers */ // range -altStyle &.-hasIndicator { // follows same logic as base element #{$self}__body { margin-top: $custom-range-thumb-height*1.75; } } &.-rate { --custom-range-progress-color: var(--sys-color-background-status-success-120); --custom-range-track-color: var(--sys-color-background-highlight-60); #{$self}__min { color: var(--custom-range-progress-color); } #{$self}__max { color: var(--custom-range-track-color); } } &.-alignToInput { @extend .form-control; border-bottom: 0; display: flex; width: 100%; align-items: flex-end; padding: 0; #{$self}__body { width: 100%; } } /* random parent element */ /* * * Syntax : .randomParentElt & {} * */ /* Pseudo Classes */ &:hover { @media (hover: hover) { } } &:focus { } &:active { } &:focus, &:active { } }