Skip to content

Commit

Permalink
refactor: minor refactor of input with vars and state modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
sebnitu committed May 23, 2021
1 parent 1c0bbd2 commit 3b13a1a
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 7 deletions.
16 changes: 16 additions & 0 deletions docs/dist/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions docs/dist/styles.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/styles.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/styles.min.css.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions packages/input/src/_input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ $_b: var.$prefix-block;
background-color: var.$background-focus;
}

&[disabled] {
background-color: var.$background-disabled;
}

&[readonly] {
background-color: var.$background-readonly;
}

&::placeholder {
color: core.$color-subtle;
}
Expand Down
12 changes: 12 additions & 0 deletions packages/input/src/_input_state.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ $_b: var.$prefix-block;
$_m: var.$prefix-modifier;
$_v: var.$prefix-modifier-value;

.#{$_b}input#{$_m}state#{$_v}info {
@include mix.box-shadow("default", rgba(core.$info, 1));

&:hover {
@include mix.box-shadow("hover", rgba(core.$info, 1));
}

&:focus {
@include mix.box-shadow("focus", rgba(core.$info, 1));
}
}

.#{$_b}input#{$_m}state#{$_v}success {
@include mix.box-shadow("default", rgba(core.$success, 1));

Expand Down
2 changes: 2 additions & 0 deletions packages/input/src/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ $color-placeholder: core.$color-subtle !default;

$background: core.$white !default;
$background-focus: core.$white !default;
$background-disabled: core.$shade !default;
$background-readonly: core.$shade !default;

$box-shadow-values: 0 0 0 1px !default;
$box-shadow-color: core.$border-color-dark !default;
Expand Down

0 comments on commit 3b13a1a

Please sign in to comment.