Skip to content

Commit 2a70a3f

Browse files
committed
Move banners to bottom-right of the screen so it does not block important content
1 parent fc4f17a commit 2a70a3f

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

frontend/src/global_styles/content/_toast.sass

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
3434
$nm-font-size: var(--body-font-size)
3535
$nm-border-radius: rem-calc(2px)
36-
$nm-box-padding: rem-calc(10px 35px 10px 35px)
37-
$nm-toaster-width: rem-calc(550)
36+
$nm-box-padding: rem-calc(10px 40px 10px 40px)
37+
$nm-toaster-width: 25%
3838

3939
$nm-color-success-border: var(--borderColor-success-muted)
4040
$nm-color-success-icon: var(--fgColor-success)
@@ -100,14 +100,13 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
100100
left: $left
101101
font-size: $size
102102

103-
104-
105103
.op-toast
106104
@include spot-z-index("toast")
107105

108106
display: flex
109107
box-shadow: rem-calc(1px 2px 3px) rgba(0, 0, 0, 0.2)
110108
border: rem-calc(1px) solid $nm-color-border
109+
border-radius: var(--borderRadius-medium)
111110
font-size: $nm-font-size
112111
word-wrap: break-word
113112
position: relative
@@ -219,14 +218,18 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
219218
.op-toast--wrapper
220219
position: absolute
221220
max-width: $nm-toaster-width
222-
margin: 0 auto
223-
left: 10%
224-
right: 10%
225-
226-
.op-toast--wrapper
221+
min-width: $nm-toaster-width
222+
margin: 0
223+
right: 2rem
224+
bottom: 2rem
227225
// Higher than loading indicator and modal wrapper!
228226
z-index: 10000
229-
top: 4rem
227+
228+
@media screen and (max-width: $breakpoint-md)
229+
max-width: calc(100% - 2rem)
230+
min-width: calc(100% - 2rem)
231+
right: 1rem
232+
230233

231234
.op-toast--casing
232235
position: relative

frontend/src/global_styles/primer/_flash.sass

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,26 @@
2626
// See COPYRIGHT and LICENSE files for more details.
2727
//++
2828
29-
$op-primer-flash-toaster-width: 80%
29+
$op-primer-flash-toaster-width: 25%
3030

3131
.op-primer-flash
3232
z-index: 599
3333
position: absolute
3434
max-width: $op-primer-flash-toaster-width
35-
margin: 0 auto
36-
left: 10%
37-
right: 10%
38-
top: 1rem
35+
min-width: $op-primer-flash-toaster-width
36+
right: 2rem
37+
bottom: 2rem
3938
background-color: var(--body-background)
4039

4140
// Align multiple toasts
4241
display: flex
4342
flex-direction: column
4443
gap: 1rem
4544

45+
@media screen and (max-width: $breakpoint-md)
46+
max-width: calc(100% - 2rem)
47+
min-width: calc(100% - 2rem)
48+
right: 1rem
49+
4650
&--item
4751
word-wrap: break-word

0 commit comments

Comments
 (0)