From 34bcfaf0fbe155633e87a8ebc569d85ae5c9a03b Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 26 Jul 2025 21:19:38 +0200 Subject: Add pill style to text field --- src/objects/_text-field.scss | 18 ++++++++++++++++++ src/objects/_text-field.vars.scss | 1 + 2 files changed, 19 insertions(+) (limited to 'src/objects') diff --git a/src/objects/_text-field.scss b/src/objects/_text-field.scss index 6c0e7d2..2beff5f 100644 --- a/src/objects/_text-field.scss +++ b/src/objects/_text-field.scss @@ -104,6 +104,24 @@ } } + @include bem.modifier('pill') { + border-radius: 100em; + + @include bem.elem('bg') { + border-radius: 100em; + } + + @include bem.elem('native') { + padding-inline: props.get(vars.$pad-i-pill); + + &:focus { + @include bem.sibling-elem('bg') { + border-radius: 100em; + } + } + } + } + @include bem.modifier('extended') { padding: props.get(vars.$extended--pad); diff --git a/src/objects/_text-field.vars.scss b/src/objects/_text-field.vars.scss index f64c42b..51099d8 100644 --- a/src/objects/_text-field.vars.scss +++ b/src/objects/_text-field.vars.scss @@ -4,6 +4,7 @@ $line-height: props.def(--o-text-field--line-height, 1.4) !default; $pad-i: props.def(--o-text-field--pad-i, props.get(core.$size--125)) !default; +$pad-i-pill: props.def(--o-text-field--pad-i-pill, props.get(core.$size--175)) !default; $pad-b: props.def(--o-text-field--pad-b, props.get(core.$size--125)) !default; $border-width: props.def(--o-text-field--border-width, props.get(core.$border-width--thin)) !default; $rounding: props.def(--o-text-field--rounding, props.get(core.$rounding--sm)) !default; -- cgit v1.2.3-70-g09d2