styled-theme icon indicating copy to clipboard operation
styled-theme copied to clipboard

Palette color by index

Open sultan99 opened this issue 7 years ago • 0 comments

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>

sultan99 avatar Jul 27 '18 06:07 sultan99