created:12/30/2020
updated:12/30/2020
loc
182
comments
5%
BoltColor
Color item displaying the color as a block with AA color contrast tests. Design inspired by Bolt.
Name | Description | Default | Controls |
---|---|---|---|
name | name of the color, If none, or same as the color value, some color blocks will not display it string | - | |
color | color value as a string. accepted hex, rgb, hsl color strings ColorValue | - | |
hover | hover prop boolean | - | |
blackTextColor | text color for the theme. this property is used for AA contrast testing. by default, this is black = #000000 string | #000000 | |
whiteTextColor | dark mode text color for the theme. this property is used for AA contrast testing. by default, this is white = #ffffff string | #ffffff |
6 commits
package | imports | peer |
---|---|---|
CopyContainer | ||
@primer/octicons-react ^10.0.0 | XCircleFillIconCheckCircleFillIcon | |
react ^17.0.1 | FC | * |
theme-ui ^0.8.4 | jsx | |
tinycolor2 ^1.4.1 | tinycolor |
file | imports |
---|---|
"../utils" | colorToStrmostReadable |
"../../types" | ColorBlockPropsColorValuecolorContrastdefaultBlackTextColordefaultWhiteTextColorThemeColorProps |
"../../containers" | GridContainerPropsGridContainer |
Navy
#001f5f
var(--bolt-color-navy) | ||
Text size | Aa | Aa |
#ffffff (15.43) | pass | pass |
#000000 (1.36) | fail | fail |
Teal
#10a5ac
var(--bolt-color-teal) | ||
Text size | Aa | Aa |
#ffffff (3.00) | pass | fail |
#000000 (7.00) | pass | pass |
Orange
#f76923
var(--bolt-color-orange) | ||
Text size | Aa | Aa |
#ffffff (3.00) | pass | fail |
#000000 (7.00) | pass | pass |
Yellow
#ffc836
var(--bolt-color-yellow) | ||
Text size | Aa | Aa |
#ffffff (1.55) | fail | fail |
#000000 (13.57) | pass | pass |
Wine
#661d34
var(--bolt-color-wine) | ||
Text size | Aa | Aa |
#ffffff (11.73) | pass | pass |
#000000 (1.79) | fail | fail |
Pink
#e63690
var(--bolt-color-pink) | ||
Text size | Aa | Aa |
#ffffff (3.97) | pass | fail |
#000000 (5.29) | pass | pass |
Berry
#ac1361
var(--bolt-color-berry) | ||
Text size | Aa | Aa |
#ffffff (6.95) | pass | pass |
#000000 (3.02) | pass | fail |
Violet
#5f67b9
var(--bolt-color-violet) | ||
Text size | Aa | Aa |
#ffffff (5.09) | pass | pass |
#000000 (4.13) | pass | fail |
Gray
#8d8e99
var(--bolt-color-gray) | ||
Text size | Aa | Aa |
#ffffff (3.25) | pass | fail |
#000000 (6.46) | pass | pass |
Black
#151619
var(--bolt-color-black) | ||
Text size | Aa | Aa |
#ffffff (18.09) | pass | pass |
#000000 (1.16) | fail | fail |
White
#ffffff
var(--bolt-color-white) | ||
Text size | Aa | Aa |
#ffffff (1.00) | fail | fail |
#000000 (21.00) | pass | pass |