Colors
@happeouikit/colors
yarn add @happeouikit/colors
@happeouikit/theme@^1.9.0
polished@^2.3.1
New Colors (DS3) - use CSS variables and theme provider!
From 2024 onwards, we should only be using CSS variables for colors (e.g. var(--color-active-primary)
, or
on rare occasions, colors from useTheme
. These are defined and exported in @happeouikit/theme
.
Additionally, many colors should be semantic - e.g. --color-surface
rather than --color-white100
- which will allow
us to support more themes, like Dark Mode, in the future.
var(--color-navy800)
var(--color-active-primary)
var(--color-success-primary)
var(--color-warning-primary)
var(--color-alert-primary)
var(--color-violet800)
Please don't import anything from this package anymore!
We will gradually remove references to most of its contents by replacing them with CSS vars.
We may keep using darken, lighten, and toBgColor for a while longer, but remember that most of the time you could be
replacing colors with direct CSS vars, or semantic ones -
e.g. darken(active, 0.2)
should become "var(--color-active-darken20)"
.
Primary Colors
Each primary color is exported by it's name, so use that rather than the HEX code.
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
Happeo Brand
#29C4A9
#00E5BD
Grayscale
Grayscale is used primarily. When grayscale texts are used on top of an image or colorful background, choose Black and it’s opacities below
#2A3443
#343E49
#434F59
#5A6872
#8997A1
#BAC6D0
#D4DBE1
#E8ECF2
#F7F9FB
#FBFCFD
Black & white
#000000
rgba(0,0,0,0.7)
rgba(0,0,0,0.5)
rgba(0,0,0,0.3)
#FFFFFF
rgba(255,255,255,0.7)
Lighten & Darken
For darkening and lightening there is functions ready.
color-mix(in srgb, #5E2590, black 80%)
color-mix(in srgb, #1A5D8D, white 80%)
Below in the list there is examples of all the primary colors shaded.
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590
#1A5D8D
#009DFF
#29C47F
#FABD24
#EC4B2F
#5E2590