Skip to content

Commit

Permalink
feat(theme): Add error and on-error support (#3469)
Browse files Browse the repository at this point in the history
The text field component has been updated to use the newly added error color from the theme.
  • Loading branch information
williamernest authored Aug 29, 2018
1 parent 533a46f commit b10095f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mdc-textfield/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
$mdc-text-field-error: #b00020;
$mdc-text-field-error: error;
$mdc-text-field-fullwidth-bottom-line-color: rgba(mdc-theme-prop-value(on-surface), .12);
$mdc-text-field-disabled-border: rgba(mdc-theme-prop-value(on-surface), .06);
$mdc-text-field-disabled-icon: rgba(mdc-theme-prop-value(on-surface), .3);
Expand Down
6 changes: 6 additions & 0 deletions packages/mdc-theme/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ $mdc-theme-background: #fff !default; // White
$mdc-theme-surface: #fff !default;
$mdc-theme-on-surface: if(mdc-theme-contrast-tone($mdc-theme-surface) == "dark", #000, #fff) !default;

$mdc-theme-error: #b00020;
$mdc-theme-on-error: #fff;

//
// Text colors according to light vs dark and text type.
//
Expand Down Expand Up @@ -87,9 +90,12 @@ $mdc-theme-property-values: (
background: $mdc-theme-background,
// Surface
surface: $mdc-theme-surface,
// Error
error: $mdc-theme-error,
on-primary: $mdc-theme-on-primary,
on-secondary: $mdc-theme-on-secondary,
on-surface: $mdc-theme-on-surface,
on-error: $mdc-theme-on-error,
// Text-primary on "background" background
text-primary-on-background: mdc-theme-ink-color-for-fill_(primary, $mdc-theme-background),
text-secondary-on-background: mdc-theme-ink-color-for-fill_(secondary, $mdc-theme-background),
Expand Down

0 comments on commit b10095f

Please sign in to comment.