system-ui / theme-specification

A specification for defining theme objects & design tokens for use with UI components
https://system-ui.com/theme
531 stars 19 forks source link

Should top/bottom/left/right refer to space theme values? #7

Open daniellizik opened 4 years ago

daniellizik commented 4 years ago

Seems like absolutely positioned components are ignoring the values set in space. Is this by design (nothing in the docs)? What is the idiomatic way to write this?

styled.div`
  position: aboslute;
  left: 0; // not css value 0, but 0 index in the theme.space array
  bottom: 0;
`;

Position is an excluded value, I can see why, but I'd like to be able to set the coordinates based on themed space values

jxnblk commented 4 years ago

Position properties have never used theme.space in Styled System (you can use margin instead), which is probably why it's not currently in this specification, but I think it could make sense to add it here if you want to open a PR