Commit c423d5ef authored by Phil Hughes's avatar Phil Hughes

Merge branch 'jh_flash_messages_styling_22992' into 'master'

Update designs of flash messages sitewide

See merge request gitlab-org/gitlab!18369
parents 800f31d6 5e5269ab
...@@ -37,7 +37,7 @@ const createAction = config => ` ...@@ -37,7 +37,7 @@ const createAction = config => `
`; `;
const createFlashEl = (message, type) => ` const createFlashEl = (message, type) => `
<div class="flash-content flash-${type} rounded"> <div class="flash-${type}">
<div class="flash-text"> <div class="flash-text">
${_.escape(message)} ${_.escape(message)}
<div class="close-icon-wrapper js-close-icon"> <div class="close-icon-wrapper js-close-icon">
......
...@@ -282,8 +282,7 @@ pre code { ...@@ -282,8 +282,7 @@ pre code {
white-space: pre-wrap; white-space: pre-wrap;
} }
.alert, .alert {
.flash-notice {
border-radius: 0; border-radius: 0;
} }
...@@ -310,12 +309,10 @@ pre code { ...@@ -310,12 +309,10 @@ pre code {
.alert-success, .alert-success,
.alert-info, .alert-info,
.alert-warning, .alert-warning,
.alert-danger, .alert-danger {
.flash-notice {
color: $white-light; color: $white-light;
h4, h4,
a:not(.btn),
.alert-link { .alert-link {
color: $white-light; color: $white-light;
} }
......
$notification-box-shadow-color: rgba(0, 0, 0, 0.25); $notification-box-shadow-color: rgba(0, 0, 0, 0.25);
.flash-container { .flash-container {
margin: 0; margin-top: 10px;
margin-bottom: $gl-padding; margin-bottom: $gl-padding;
font-size: 14px; font-size: 14px;
position: relative; position: relative;
...@@ -12,17 +12,22 @@ $notification-box-shadow-color: rgba(0, 0, 0, 0.25); ...@@ -12,17 +12,22 @@ $notification-box-shadow-color: rgba(0, 0, 0, 0.25);
position: -webkit-sticky; position: -webkit-sticky;
top: $flash-container-top; top: $flash-container-top;
z-index: 251; z-index: 251;
}
.flash-content { &.flash-container-page {
box-shadow: 0 2px 4px 0 $notification-box-shadow-color; margin-bottom: 0;
} }
&:empty {
margin: 0;
} }
.close-icon-wrapper { .close-icon-wrapper {
padding: ($gl-btn-padding + $gl-padding-4) $gl-padding $gl-btn-padding; padding: ($gl-padding + $gl-padding-4) $gl-padding $gl-padding;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
bottom: 0;
cursor: pointer; cursor: pointer;
.close-icon { .close-icon {
...@@ -31,13 +36,11 @@ $notification-box-shadow-color: rgba(0, 0, 0, 0.25); ...@@ -31,13 +36,11 @@ $notification-box-shadow-color: rgba(0, 0, 0, 0.25);
} }
} }
.flash-notice,
.flash-alert, .flash-alert,
.flash-notice,
.flash-success, .flash-success,
.flash-warning { .flash-warning {
border-radius: $border-radius-default; padding: $gl-padding $gl-padding-32 $gl-padding ($gl-padding + $gl-padding-4);
color: $white-light;
padding-right: $gl-padding * 2;
.container-fluid, .container-fluid,
.container-fluid.container-limited { .container-fluid.container-limited {
...@@ -45,75 +48,31 @@ $notification-box-shadow-color: rgba(0, 0, 0, 0.25); ...@@ -45,75 +48,31 @@ $notification-box-shadow-color: rgba(0, 0, 0, 0.25);
} }
} }
.flash-notice { .flash-alert {
@extend .alert; background-color: $red-100;
background-color: $blue-500; color: $red-700;
margin: 0; }
&.flash-notice-persistent {
background-color: $blue-100;
color: $gl-text-color;
a { .flash-notice {
color: $blue-600; background-color: $blue-100;
color: $blue-700;
}
&:hover { .flash-success {
color: $blue-800; background-color: $theme-green-100;
text-decoration: none; color: $green-700;
}
}
}
} }
.flash-warning { .flash-warning {
@extend .alert;
background-color: $orange-100; background-color: $orange-100;
color: $orange-900; color: $orange-800;
cursor: default; cursor: default;
margin: 0;
} }
.flash-text, .flash-text,
.flash-action { .flash-action {
display: inline-block; display: inline-block;
} }
.flash-alert {
@extend .alert;
background-color: $red-500;
margin: 0;
.flash-action {
margin-left: 5px;
text-decoration: none;
font-weight: $gl-font-weight-normal;
border-bottom: 1px solid;
&:hover {
border-color: transparent;
}
}
}
.flash-success {
@extend .alert;
background-color: $green-500;
margin: 0;
}
&.flash-container-page {
margin-bottom: 0;
.flash-notice,
.flash-alert,
.flash-success {
border-radius: 0;
}
}
&:empty {
margin: 0;
}
} }
@include media-breakpoint-down(sm) { @include media-breakpoint-down(sm) {
......
...@@ -33,7 +33,8 @@ body { ...@@ -33,7 +33,8 @@ body {
&.limit-container-width { &.limit-container-width {
.flash-container.sticky { .flash-container.sticky {
max-width: $limited-layout-width; max-width: $limited-layout-width;
margin: 0 auto; margin-right: auto;
margin-left: auto;
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- flash.each do |key, value| - flash.each do |key, value|
-# Don't show a flash message if the message is nil -# Don't show a flash message if the message is nil
- if value - if value
%div{ class: "flash-content flash-#{key} rounded" } %div{ class: "flash-#{key}" }
%span= value %span= value
%div{ class: "close-icon-wrapper js-close-icon" } %div{ class: "close-icon-wrapper js-close-icon" }
= sprite_icon('close', size: 16, css_class: 'close-icon') = sprite_icon('close', size: 16, css_class: 'close-icon')
---
title: Update flash messages color sitewide
merge_request: 18369
author:
type: changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment