-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2490 from carpentries/feature/change-color-palette
Update color palette for better accessibility
- Loading branch information
Showing
9 changed files
with
495 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// custom_bootstrap.scss | ||
|
||
// after editing, compile with Sass: | ||
// $ npx sass amy/static/scss/custom_bootstrap.scss amy/static/css/custom_bootstrap.min.css --style compressed | ||
|
||
// Color system | ||
// Majority taken from Bootstrap 5 palette | ||
// https://getbootstrap.com/docs/5.0/customize/color/ | ||
|
||
$white: #fff; | ||
$gray-100: #f8f9fa; | ||
$gray-200: #e9ecef; | ||
$gray-300: #dee2e6; | ||
$gray-400: #ced4da; | ||
$gray-500: #adb5bd; | ||
$gray-600: #6c757d; // hsl(208, 7, 46) | ||
$gray-650: hsl(209, 8, 38); // custom | ||
$gray-700: #495057; // hsl(210, 9, 31) | ||
$gray-800: #343a40; | ||
$gray-900: #212529; | ||
$black: #000; | ||
|
||
$blue: #0060f0; // custom for better contrast with .table-striped and .alert-* | ||
$indigo: #6610f2; | ||
$purple: #6f42c1; | ||
$pink: #d63384; | ||
$red: #dc3545; | ||
$orange: #fd7e14; | ||
$yellow: #ffc107; | ||
$green: #198754; | ||
$teal: #20c997; | ||
$cyan: #0dcaf2; // very slightly custom to be a light enough background to switch to dark text | ||
|
||
$colors: ( | ||
"blue": $blue, | ||
"indigo": $indigo, | ||
"purple": $purple, | ||
"pink": $pink, | ||
"red": $red, | ||
"orange": $orange, | ||
"yellow": $yellow, | ||
"green": $green, | ||
"teal": $teal, | ||
"cyan": $cyan, | ||
"black": $black, | ||
"white": $white, | ||
"gray": $gray-600, | ||
"gray-dark": $gray-800 | ||
); | ||
|
||
$primary: $blue ; | ||
$secondary: $gray-650; // custom for improved contrast everywhere | ||
$success: $green ; | ||
$info: $cyan ; | ||
$warning: $yellow ; | ||
$danger: $red ; | ||
$light: $gray-100 ; | ||
$dark: $gray-800 ; // custom for improved contrast with $blue (i.e. between text & links) | ||
|
||
$theme-colors: ( | ||
"primary": $primary, | ||
"secondary": $secondary, | ||
"success": $success, | ||
"info": $info, | ||
"warning": $warning, | ||
"danger": $danger, | ||
"light": $light, | ||
"dark": $dark | ||
); | ||
|
||
// include all of Bootstrap | ||
|
||
@import "../../../node_modules/bootstrap/scss/bootstrap"; | ||
|
||
// override some color settings | ||
|
||
.navbar-expand-lg .navbar-nav .nav-link { | ||
color: $gray-500; | ||
} | ||
|
||
.navbar-expand-lg .navbar-nav .nav-link:hover, | ||
.navbar-dark .navbar-nav .nav-link:focus { | ||
color: $white; | ||
} | ||
|
||
.navbar-dark .navbar-nav .show>.nav-link, | ||
.navbar-dark .navbar-nav .active>.nav-link, | ||
.navbar-dark .navbar-nav .nav-link.show, | ||
.navbar-dark .navbar-nav .nav-link.active { | ||
color: $white; | ||
} | ||
|
||
// rarely used; prefer .badge-info and .badge-warning | ||
.text-info, | ||
.text-warning { | ||
background-color: $dark; // necessary for contrast | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.