styled-theme
styled-theme copied to clipboard
Palette color by index
Is there way to select palette color by index?
// my theme
theme.palette = {
primary: [`#08C4FA`, `#34CEFA`, `#61D9FB`, `#8EE4FC`, `#BBEEFD`]
}
const Span = styled.span`
color: ${palette({grayscale: 0}, 0)};
font-family: ${font(`primary`)};
font-size: ${prop(`size`, `14px`)};
`
<Span palette={{primary: 2}}>Text</Span>
// or
<Span palette="primary" tone={2}>Text</Span>