Skip to content

Commit

Permalink
feat(colors): adds color scheme utility classes (incl. dark one)
Browse files Browse the repository at this point in the history
re #147

affects: @buildit/gravity-ui-web
  • Loading branch information
James Nash committed May 2, 2019
1 parent 9b4826b commit 3a0a0c1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,35 @@ $grav-co-scheme-light: (
);


/// Dark colour scheme.
$grav-co-scheme-dark: (
// == Group A colours ==
'group-a': (
'neutral': $grav-co-wipro-dark-gray,
'neutral-alt': $grav-co-wipro-dark-gray,
'accent': $grav-co-wipro-dark-gray,
'accent-success': $grav-co-wipro-dark-gray,
'accent-attention': $grav-co-wipro-dark-gray,
'accent-danger': $grav-co-wipro-dark-gray,
),

// == Group B colours ==
'group-b': (
'neutral': $grav-co-wipro-white,
'neutral-subtle': $grav-co-wipro-white,
'neutral-emphasis': $grav-co-wipro-white,
'control': $grav-co-wipro-teal-80,
'control-alt': $grav-co-wipro-violet-80,
'control-emphasis': $grav-co-wipro-teal-100,
'control-active': $grav-co-wipro-teal-100,
'control-disabled': $grav-co-wipro-white,
'accent': $grav-co-wipro-red-60,
'accent-success': $grav-co-wipro-white,
'accent-attention': $grav-co-wipro-white,
'accent-danger': $grav-co-wipro-white,
),
);



/// The default colour scheme that is applied to pages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@
@include grav-color-grp-b-apply('color', 'neutral', $use-fallback);
}

/// Defines a color scheme CSS class.
@mixin grav-color-scheme-define-class($color-scheme-name, $color-scheme-map) {
#{grav-color-scheme-class-name($color-scheme-name)} {
@include grav-color-scheme-props($color-scheme-map);
@include grav-color-scheme-apply;
/// Defines a color scheme CSS class(es).
@mixin grav-color-scheme-define-class($color-scheme-names, $color-scheme-map) {
@each $name in $color-scheme-names {
#{grav-color-scheme-class-name($name)} {
@include grav-color-scheme-props($color-scheme-map);
@include grav-color-scheme-apply;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// === Utilities layer ===
// Utilities and helper classes with ability to override anything which goes before in the
// triangle, eg. hide helper class.
@import 'color-schemes';
@import 'text';
8 changes: 8 additions & 0 deletions src/ui-lib/sass/06-utilities/_color-schemes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Utility class for default colour scheme
@include grav-color-scheme-define-class('default', $grav-co-scheme-default);

// Utility class for light colour scheme
@include grav-color-scheme-define-class('light', $grav-co-scheme-light);

// Utility class for dark colour scheme
@include grav-color-scheme-define-class('dark', $grav-co-scheme-dark);

0 comments on commit 3a0a0c1

Please sign in to comment.