diff --git a/docs/docs/tokens/color.md b/docs/docs/tokens/color.md index 4420b45ef..334a430a8 100644 --- a/docs/docs/tokens/color.md +++ b/docs/docs/tokens/color.md @@ -1,6 +1,7 @@ --- title: Color description: Ensure consistent use of color and readable contrast with Web Awesome's color properties. +wide: true --- Web Awesome's color system is made up of CSS custom properties to help with consistent color use throughout your project. @@ -64,21 +77,125 @@ You can use these numbers to ensure accessible color contrast per [WCAG 2.1 succ - A difference of 50 ensures a minimum 4.5:1 contrast ratio, suitable for normal text (AA) and large text (AAA) - A difference of 60 ensures a minimum 7:1 contrast ratio, suitable for all text (AAA) -Each Web Awesome palette defines seven literal colors each with 11 lightness values using the format `--wa-color-{hue}-{tint}`. +Each Web Awesome palette defines eight literal colors each with 11 lightness values using the format `--wa-color-{hue}-{tint}`. +Additionally, the "core" (most vibrant) color of each scale is mapped to `--wa-color-{hue}`. +{% set tints = ["95", "90", "80", "70", "60", "50", "40", "30", "20", "10", "05"] -%} + + + + + + + {% for tint in tints -%} + + {%- endfor %} + + {% for hue in hues -%} -
{{ hue | capitalize }}
- + + + {% for tint in tints -%} + + {%- endfor -%} + {%- endfor %} +
Core tint{{ tint }}
{{ hue | capitalize }} +
+ +
+
- {{ tint }} - - {%- endfor %} - +
+ +## Bounded Core Colors + +In addition to the literal color scales above and their core colors, +we also define variables for "bounded" core colors, which resolve to the core color of the hue's scale, +but clamped to a specific tint. + +This is useful for using core colors while ensuring a minimum contrast ratio with other colors in your theme. + +### Upper Bound Core Colors + +These variables resolve to the core color as long as it is equal or below the specified tint, +and to the specified tint otherwise. + +{% set tints_clamped = ['40', '50', '60', '70'] %} + + + + + + + {% for tint in tints_clamped -%} + + {%- endfor %} + + +{% for hue in hues -%} + + + + {% for tint in tints_clamped -%} + + {%- endfor -%} + +{%- endfor %} +
Core tintmax-{{ tint }}
{{ hue | capitalize }} +
+ {{ palettes[paletteId][hue].maxChromaTint -}} + +
+
+
+ +
+
+ +### Lower Bound Core Colors + +These variables resolve to the core color as long as it is at least at the specified tint, +and to the specified tint otherwise. + + + + + + + {% for tint in tints_clamped -%} + + {%- endfor %} + + +{% for hue in hues -%} + + + + {% for tint in tints_clamped -%} + + {%- endfor -%} + +{%- endfor %} +
Core tintmin-{{ tint }}
{{ hue | capitalize }} +
+ {{ palettes[paletteId][hue].maxChromaTint -}} + +
+
+
+ +
+
## Foundational Colors