Skip to content

Commit 254eaa0

Browse files
authored
fix(inline-notification): fix inline-notification styles on mobile (#5763)
* fix(inline-notification): fix inline-notification styles on mobile * fix(inline-notfication): fix ie11 bug * fix(inline-notfication): remove top margin on mobile
1 parent af0626b commit 254eaa0

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

packages/components/src/components/notification/_inline-notification.scss

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
@include reset;
2525

2626
display: flex;
27+
flex-wrap: wrap;
2728
position: relative;
2829
height: auto;
2930
min-height: rem(48px);
@@ -36,6 +37,7 @@
3637

3738
@include carbon--breakpoint(md) {
3839
max-width: rem(608px);
40+
flex-wrap: nowrap;
3941
}
4042

4143
@include carbon--breakpoint(lg) {
@@ -158,7 +160,11 @@
158160
.#{$prefix}--inline-notification__details {
159161
display: flex;
160162
flex-grow: 1;
161-
margin: 0 $carbon--spacing-05;
163+
margin: 0 $carbon--spacing-09 0 $carbon--spacing-05;
164+
165+
@include carbon--breakpoint(md) {
166+
margin: 0 $carbon--spacing-05;
167+
}
162168
}
163169

164170
.#{$prefix}--inline-notification__icon {
@@ -185,7 +191,12 @@
185191

186192
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost {
187193
height: rem(32px);
188-
margin: $carbon--spacing-03 0;
194+
margin-bottom: $carbon--spacing-03;
195+
margin-left: $carbon--spacing-08;
196+
197+
@include carbon--breakpoint(md) {
198+
margin: $carbon--spacing-03 0;
199+
}
189200

190201
&,
191202
&:hover,
@@ -212,6 +223,9 @@
212223

213224
.#{$prefix}--inline-notification__close-button {
214225
@include focus-outline('reset');
226+
position: absolute;
227+
top: 0;
228+
right: 0;
215229
display: flex;
216230
flex-direction: column;
217231
justify-content: center;
@@ -235,6 +249,10 @@
235249
.#{$prefix}--inline-notification__close-icon {
236250
fill: $inverse-01;
237251
}
252+
253+
@include carbon--breakpoint(md) {
254+
position: static;
255+
}
238256
}
239257

240258
.#{$prefix}--inline-notification--low-contrast {

packages/react/src/components/Notification/Notification-story.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ const notificationProps = () => ({
2626
lowContrast: boolean('Use low contrast variant (lowContrast)', false),
2727
role: text('ARIA role (role)', 'alert'),
2828
title: text('Title (title)', 'Notification title'),
29-
subtitle: (
30-
<span>
31-
Subtitle text goes here. <a href="#example">Example link</a>
32-
</span>
33-
),
29+
subtitle: text('Subtitle (subtitle)', 'Subtitle text goes here.'),
3430
iconDescription: text(
3531
'Icon description (iconDescription)',
3632
'describes the close button'

0 commit comments

Comments
 (0)