@mixin input ($class) { .#{$class}-wrap { position: relative; } .#{$class} { appearance: none; box-sizing: border-box; font-size: $input-font-size-base; line-height: $line-height-base; font-family: $font-family-text; width: 100%; padding: $input-padding-vertical $space-x-small; height: $input-height; color: $text-color-base; background: $background-color-soft; border: $input-border-size solid $border-color-softer; border-radius: $border-radius-base; outline: none; transition: all $duration-short $ease-out; &::placeholder { color: $text-color-disabled; } .ds-input-has-focus &, &:focus { border-color: $border-color-active; background: $background-color-base; } .ds-input-is-disabled &, &:disabled { color: $text-color-disabled; opacity: $opacity-disabled; pointer-events: none; cursor: not-allowed; background-color: $background-color-disabled; } .ds-input-is-readonly & { pointer-events: none; } .ds-input-has-error & { border-color: $border-color-danger; } } .ds-input-size-small { font-size: $font-size-small; .#{$class} { font-size: $input-font-size-small; height: $input-height-small; padding: $input-padding-vertical-small $space-x-small; } } .ds-input-size-large { font-size: $font-size-large; .#{$class} { font-size: $input-font-size-large; height: $input-height-large; padding: $input-padding-vertical-large $space-x-small; } } .#{$class}-icon, .#{$class}-icon-right { position: absolute; top: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; width: $input-height; color: $text-color-softer; transition: color $duration-short $ease-out; pointer-events: none; .ds-input-has-focus & { color: $text-color-base; } .ds-input-size-small & { width: $input-height-small; } .ds-input-size-large & { width: $input-height-large; } } .#{$class}-icon-right { right: 0; left: auto; } .#{$class}-has-icon { padding-left: $input-height; .ds-input-size-small & { padding-left: $input-height-small; } .ds-input-size-large & { padding-left: $input-height-large; } } .#{$class}-has-icon-right { padding-right: $input-height; .ds-input-size-small & { padding-right: $input-height-small; } .ds-input-size-large & { padding-right: $input-height-large; } } }