@use "sass:math"; /* variables specific to current element */ $search-input-height-large: map-deep-get($token-sizes-unit-map, "56"); .#{$namespace}search { /* Save root element context for easy access if nesting is needed */ $self: &; /* properties of current element + media queries */ flex-grow: 1; border-radius: map-deep-get($token-radius-map, "32"); position: relative; z-index: z("zero"); /* 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 */ // search__inner &__inner { display: flex; align-items: center; padding-left: $input-padding-x*2; padding-right: $input-padding-x; border-radius: inherit; @include custom-prop-fallback("background-color","sys-color-elevation-surface-flat"); @include custom-prop-fallback("border-color","sys-color-elevation-surface-flat"); border: 0; height: $search-input-height-large; position: relative; &::after { content: ""; display: block; position: absolute; z-index: z("negative"); top: 0; left: 0; width: 100%; height: 100%; box-shadow: map-deep-get($token-shadow-map, "active"); opacity: 1; transition: opacity 0.25s linear; border-radius: inherit; } } // search__input &__input { // follows same logic as parent background-color: transparent !important; height: auto; border: none; border-radius: inherit; } &__actions { display: flex; align-items: center; flex-shrink: 0; @include spacer-component-inline("sm"); } &__searchIcon { @include custom-prop-fallback("color","sys-color-text-primary-muted"); } &__clear, &__searchBtn { display: none; } /* modifiers */ &.-isFocused.-isFocused { #{$self}__inner { @include custom-prop-fallback("background-color","sys-color-elevation-surface-flat"); @include custom-prop-fallback("border-color","sys-color-elevation-surface-flat"); &::after { opacity: 1; } } } &.-clearActive { #{$self}__clear, #{$self}__searchBtn { display: inline-flex; } } &.-performSearchVisible { #{$self}__searchBtn { display: none; } } &.-inverted { #{$self}__inner { @include custom-prop-fallback("background-color","sys-color-elevation-surface-sunken"); &::after { opacity: 0; } } } &.-small { #{$self}__inner { height: $input-height; padding-right: $input-padding-x; } #{$self}__actions { //@include spacer-component-inline("xs"); } } /* random parent element */ /* * * Syntax : .randomParentElt & {} * */ /* Pseudo Classes */ &:hover { @media (hover: hover) { } } &:focus { } &:active { } &:focus, &:active { } }