Skip to content

Commit

Permalink
Merge pull request #604 from Sinetheta/admin-flash
Browse files Browse the repository at this point in the history
Rebrand admin flash notifications
  • Loading branch information
Andrew Thal committed Dec 23, 2015
2 parents 7f971e1 + f3ad92f commit 6d0564a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,32 @@
z-index: 1000;
}

@mixin flash-variant($color) {
color: $color;
background-color: rgba($color, 0.3);
}

.flash {
padding: 16px;
text-align: center;
padding: 1em;
font-size: 120%;
color: $color-1;
font-weight: $font-weight-bold;

&.notice { background-color: rgba($color-notice, 0.8) }
&.success { background-color: rgba($color-success, 0.8) }
&.error { background-color: rgba($color-error, 0.8) }
&.notice {
@include flash-variant($color-notice);
}

&.success {
@include flash-variant($color-success);
@include prepend-icon($character-check);
}

&.error {
@include flash-variant($color-error);
@include prepend-icon($character-exclamation);
}

&:before {
margin-right: 1em;
}
}

.alert {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ $base-font-family: "Open Sans", "Helvetica Neue", "Helvetica", Helvetica, Arial,
//--------------------------------------------------------------

// Basic color palette for admin
$apple: hsl(105, 48, 37) !default;
$old-brick: hsl(5, 67, 36) !default;
$pirate-gold: hsl(45, 100, 37) !default;

$color-1: #FFFFFF !default; // White
$color-2: #9FC820 !default; // Green
$color-3: #5498DA !default; // Light Blue
Expand Down Expand Up @@ -41,9 +45,9 @@ $color-navbar-submenu-bg: very-light($color-navbar-bg, 4) !default;
$color-navbar-text: $color-1 !default;

// Basic flash colors
$color-success: $color-2 !default;
$color-notice: $color-6 !default;
$color-error: $color-5 !default;
$color-success: $apple !default;
$color-notice: $pirate-gold !default;
$color-error: $old-brick !default;

// Color for spinner
$color-spinner: #fff;
Expand Down Expand Up @@ -195,3 +199,8 @@ $width-sidebar-flyout: 225px !default;
// Stacking
//--------------------------------------------------------------
$z-index-navbar-flyout: 1000;

// Characters
//--------------------------------------------------------------
$character-check: "\f00c";
$character-exclamation: "\f12a";
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@mixin prepend-icon($character) {
&:before {
@extend .fa;
content: $character;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@import 'spree/backend/globals/variables';

@import 'spree/backend/globals/mixins/caret';
@import 'spree/backend/globals/mixins/prepend_icon';

@import 'spree/backend/shared/typography';
@import 'spree/backend/shared/tables';
Expand Down

0 comments on commit 6d0564a

Please sign in to comment.