c8r / lab

React UI component design tool
https://compositor.io/lab
349 stars 14 forks source link

Can't reference spacing from within style object #5

Closed mattmarcello closed 6 years ago

mattmarcello commented 7 years ago

It would be nice to be able to reference the spacing values when styling components.

Consider the below example.

image

image

I'd like to be able to reference the third step in the spacing scale so that changes in the scale will propagate down to the component.

Maybe a cheap solution would be to allow users to specify default props other than those set in the visual editor.

# props 
{
  mr: 3,
  ml: 3,
}
jxnblk commented 7 years ago

Thanks for the suggestion! We're working on a better solution for using thematic values within the style object, but in version 0.0.49, you can set styled-system props like in your example with mr and ml

johno commented 6 years ago

Hey @mattmarcello,

This feature is now supported in the latest versions of Lab. You can specify either default props and/or reference the theme as props in the styles.

Thanks for opening this issue!