created:12/30/2020
updated:12/30/2020
loc
167
comments
6%
PajamasColor
Color item displaying the color as a table row, expanding on hover to display the contrast and passing level. Design inspired by GitLab's Pajamas.
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 |
package | imports | peer |
---|---|---|
CopyContainer | ||
react ^17.0.1 | useStateuseMemoFC | * |
theme-ui ^0.8.4 | jsx | |
tinycolor2 ^1.4.1 | tinycolor |
file | imports |
---|---|
"../utils" | colorToStrmostReadablecontrastGrade |
"../../types" | ColorBlockPropsdefaultBlackTextColordefaultWhiteTextColorThemeColorProps |
"../../containers" | FlexContainerPropsFlexContainer |