diff --git a/docs/source/backgrounds.md b/docs/source/backgrounds.md index 6b8b0f731..6fcd8518a 100644 --- a/docs/source/backgrounds.md +++ b/docs/source/backgrounds.md @@ -5,6 +5,14 @@ title: "Backgrounds" # Backgrounds + + +

Colors

+
@@ -16,6 +24,9 @@ title: "Backgrounds"
.bg-light-softer
+
+ .bg-light-softest +
@@ -27,6 +38,9 @@ title: "Backgrounds"
.bg-dark-softer
+
+ .bg-dark-softest +
@@ -195,7 +209,7 @@ div { } ``` -## Responsive +

Responsive

The background utitlies can also be used with responsive prefixes: @@ -216,42 +230,125 @@ div { ``` -## Custom backgrounds +

Customizing

-How to generate custom background utilities: +To customize the available background colors, start by creating a copy of the default `@bg-colors` variable in your own Less file: ```less -.define-text-color('primary'; - default #3498db, - 'light' #a0cfee, - 'dark' #2980b9 -;); +@bg-colors: + 'light' @color-white, + 'light-soft' @color-grey-200, + 'light-softer' @color-grey-300, + + 'dark' @color-grey-900, + 'dark-soft' @color-grey-800, + 'dark-softer' @color-grey-700, + + 'red-dark' @color-red-dark, + 'red' @color-red, + 'red-light' @color-red-light, + 'red-lightest' @color-red-lightest, + + 'orange-dark' @color-orange-dark, + 'orange' @color-orange, + 'orange-light' @color-orange-light, + 'orange-lightest' @color-orange-lightest, + + 'yellow-dark' @color-yellow-dark, + 'yellow' @color-yellow, + 'yellow-light' @color-yellow-light, + 'yellow-lightest' @color-yellow-lightest, + + 'green-dark' @color-green-dark, + 'green' @color-green, + 'green-light' @color-green-light, + 'green-lightest' @color-green-lightest, + + 'teal-dark' @color-teal-dark, + 'teal' @color-teal, + 'teal-light' @color-teal-light, + 'teal-lightest' @color-teal-lightest, + + 'blue-dark' @color-blue-dark, + 'blue' @color-blue, + 'blue-light' @color-blue-light, + 'blue-lightest' @color-blue-lightest, + + 'indigo-dark' @color-indigo-dark, + 'indigo' @color-indigo, + 'indigo-light' @color-indigo-light, + 'indigo-lightest' @color-indigo-lightest, + + 'purple-dark' @color-purple-dark, + 'purple' @color-purple, + 'purple-light' @color-purple-light, + 'purple-lightest' @color-purple-lightest, + + 'pink-dark' @color-pink-dark, + 'pink' @color-pink, + 'pink-light' @color-pink-light, + 'pink-lightest' @color-pink-lightest, +; ``` -How to use custom background utilities: +If you don't need certain background colors, remove them or comment them out to prevent those utilities from being generated: + +```less +@bg-colors: + // ... + + // 'yellow-dark' @color-yellow-dark, + // 'yellow' @color-yellow, + // 'yellow-light' @color-yellow-light, + // 'yellow-lightest' @color-yellow-lightest, + + 'green-dark' @color-green-dark, + 'green' @color-green, + 'green-light' @color-green-light, + 'green-lightest' @color-green-lightest, + + // 'teal-dark' @color-teal-dark, + // 'teal' @color-teal, + // 'teal-light' @color-teal-light, + // 'teal-lightest' @color-teal-lightest, + + 'blue-dark' @color-blue-dark, + 'blue' @color-blue, + 'blue-light' @color-blue-light, + 'blue-lightest' @color-blue-lightest, + + 'indigo-dark' @color-indigo-dark, + 'indigo' @color-indigo, + 'indigo-light' @color-indigo-light, + 'indigo-lightest' @color-indigo-lightest, + + // 'purple-dark' @color-purple-dark, + // 'purple' @color-purple, + // 'purple-light' @color-purple-light, + // 'purple-lightest' @color-purple-lightest, + + // 'pink-dark' @color-pink-dark, + // 'pink' @color-pink, + // 'pink-light' @color-pink-light, + // 'pink-lightest' @color-pink-lightest, +; +``` + +If you'd like to add new background colors, add them to the end of the `@bg-colors` variable like so: + +```less +@bg-colors: + // ... + + 'brand-primary' #cf4646, + 'brand-secondary' #f6c92e, +; +``` + +New background color utilities (including responsive versions) will be generated for those colors and can be used in your markup like any other background color utility: ```html - - -
-
-
- - -
-``` - -```less -// Using custom utilities in Less: - -div { - .bg-primary; - .bg-primary-light; - .bg-primary-dark; - - // Responsive example - .screen(lg, { - .bg-primary; - }); -} +
+ +
``` diff --git a/src/utilities/backgrounds.less b/src/utilities/backgrounds.less index 4a79b5a0d..e61fa026f 100644 --- a/src/utilities/backgrounds.less +++ b/src/utilities/backgrounds.less @@ -2,10 +2,12 @@ 'light' @color-white, 'light-soft' @color-grey-200, 'light-softer' @color-grey-300, + 'light-softest' @color-grey-400, 'dark' @color-grey-900, 'dark-soft' @color-grey-800, 'dark-softer' @color-grey-700, + 'dark-softest' @color-grey-600, 'red-dark' @color-red-dark, 'red' @color-red, diff --git a/src/utilities/borders.less b/src/utilities/borders.less index 7d6058168..b0e5e4aa0 100644 --- a/src/utilities/borders.less +++ b/src/utilities/borders.less @@ -9,8 +9,8 @@ // Colors @border-dark: @color-grey-600; -@border-dark-soft: @color-grey-400; -@border-dark-softer: @color-grey-300; +@border-dark-soft: @color-grey-500; +@border-dark-softer: @color-grey-400; @border-light: @color-white; @border-light-soft: @color-grey-200;