Skip to content

Commit

Permalink
feat(textfield): allow custom radius with CSS var (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttalbot authored Jul 30, 2022
1 parent bb4d556 commit 6528d1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libs/web-components/textfield/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
$textfield-icon-color: var(--fds-primary, #694ed6);
$textfield-icon-trailing-color: var(--fds-on-surface-medium, color.change(#000, $alpha: 0.54));



:host {
padding-top: 24px;
display: block;
@include fds.mdc(theme-primary, primary);
@include fds.mdc(theme-error, error);
Expand All @@ -28,7 +25,7 @@ $textfield-icon-trailing-color: var(--fds-on-surface-medium, color.change(#000,
max-width: 100%;
border-style: solid;
border-width: 1px;
border-radius: 4px;
border-radius: var(--fds-text-field-radius, 4px);
pointer-events: none;
}

Expand Down Expand Up @@ -79,6 +76,7 @@ $textfield-icon-trailing-color: var(--fds-on-surface-medium, color.change(#000,

.mdc-text-field--outlined {
@include fds.bg-color(surface);
border-radius: var(--fds-text-field-radius, 4px);
height: 48px;
}

Expand Down
1 change: 1 addition & 0 deletions libs/web-components/textfield/src/textfield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { styles } from './styles.css';
* @cssprop {color} [--fds-primary=#694ED6] - Textfield color
* @cssprop {color} [--fds-icon-color=#694ED6] - Icon color.
* @cssprop {color} [--fds-icon-trailing-color=#694ED6] - Icon trailing color.
* @cssprop {text} [--fds-text-field-radius=4px] - Border radius of the outline.
* @attr [label='textfield'] - Sets floating label value.
* @attr [placeholder='textfield'] - Sets placeholder value displayed when input is empty.
* @attr [required=false] - Displays error state if value is empty and input is blurred.
Expand Down

0 comments on commit 6528d1a

Please sign in to comment.