Skip to content

Commit

Permalink
fix(notifications): fix pointer events for inline low contrast, updat…
Browse files Browse the repository at this point in the history
…e inverse link colors (#4805)

* fix(inline-notification): update low contrast pointer event, link color

* fix(toast-notification): update inverse link color

* docs(notifications): update stories to have example links

* fix(notifications): update inverse link color selectors

* fix(notifications): add styles for lines inside notifications
  • Loading branch information
jendowns authored and joshblack committed Dec 10, 2019
1 parent 844db62 commit e975202
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,35 @@
}
}

.#{$prefix}--inline-notification:not(.#{$prefix}--inline-notification--low-contrast)
a {
color: $inverse-link;
}

.#{$prefix}--inline-notification a {
text-decoration: none;
}

.#{$prefix}--inline-notification a:hover {
text-decoration: underline;
}

.#{$prefix}--inline-notification a:focus {
outline: 1px solid $inverse-link;
}

.#{$prefix}--inline-notification.#{$prefix}--inline-notification--low-contrast
a:focus {
@include focus-outline;
}

.#{$prefix}--inline-notification--low-contrast {
// Stop-gap to ensure color contrast (vs. fixed background color) until we have component-specific theme tokens
color: map-get($carbon--theme--white, 'text-01');

&::before {
content: '';
pointer-events: none;
position: absolute;
top: 0;
left: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@
}
}

.#{$prefix}--toast-notification:not(.#{$prefix}--toast-notification--low-contrast)
a {
color: $inverse-link;
}

.#{$prefix}--toast-notification a {
text-decoration: none;
}

.#{$prefix}--toast-notification a:hover {
text-decoration: underline;
}

.#{$prefix}--toast-notification a:focus {
outline: 1px solid $inverse-link;
}

.#{$prefix}--toast-notification.#{$prefix}--toast-notification--low-contrast
a:focus {
@include focus-outline;
}

.#{$prefix}--toast-notification--low-contrast {
// Stop-gap to ensure color contrast (vs. fixed background color) until we have component-specific theme tokens
color: map-get($carbon--theme--white, 'text-01');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ const notificationProps = () => ({
lowContrast: boolean('Use low contrast variant (lowContrast)', false),
role: text('ARIA role (role)', 'alert'),
title: text('Title (title)', 'Notification title'),
subtitle: text('Subtitle (subtitle)', 'Subtitle text goes here.'),
subtitle: (
<span>
Subtitle text goes here. <a href="#example">Example link</a>
</span>
),
iconDescription: text(
'Icon description (iconDescription)',
'describes the close button'
Expand Down

0 comments on commit e975202

Please sign in to comment.