Skip to content

Commit

Permalink
fix(notification): update focus styles for low contrast (#5978)
Browse files Browse the repository at this point in the history
* fix(notification): update focus styles for low contrast

* Update _inline-notification.scss

* fix(notification): update focus styles for action button

* fix(notification): update hover and focus styles for action button

* fix(notification): update colors according to new spec

Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
joshblack and tw15egan authored May 12, 2020
1 parent 46d64cc commit 3b94f3c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,30 +190,43 @@
}

.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost {
color: $inverse-link;
height: rem(32px);
margin-bottom: $carbon--spacing-03;
margin-left: $carbon--spacing-08;

@include carbon--breakpoint(md) {
margin: $carbon--spacing-03 0;
}
}

&,
&:hover,
&:focus,
&:active {
color: $inverse-link;
}
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost {
color: $link-01;
}

&:focus {
border-color: transparent;
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:active,
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:hover {
background-color: $inverse-hover-ui;
}

&:hover {
background-color: $inverse-hover-ui;
}
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:active,
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:hover {
background-color: $carbon--white-0;
}

.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:focus {
border-color: transparent;
box-shadow: none;
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}

.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:focus {
outline-color: $focus;
}

.#{$prefix}--inline-notification--hide-close-button
Expand Down Expand Up @@ -256,7 +269,7 @@
}

.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__close-button {
.#{$prefix}--inline-notification__close-button:focus {
@include focus-outline('outline');
}

Expand All @@ -267,10 +280,10 @@
}

.#{$prefix}--inline-notification__action-button {
color: $carbon--blue-60;
color: $interactive-01;

&:active {
color: $carbon--blue-80;
color: $interactive-01;
}

&:active,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
}

.#{$prefix}--toast-notification--low-contrast
.#{$prefix}--toast-notification__close-button {
.#{$prefix}--toast-notification__close-button:focus {
@include focus-outline('outline');
}

Expand Down

0 comments on commit 3b94f3c

Please sign in to comment.