Skip to content

Instantly share code, notes, and snippets.

@xaviervia
Created September 6, 2017 15:01
Show Gist options
  • Save xaviervia/565475b0bddbfaff5f2bc3e890a93638 to your computer and use it in GitHub Desktop.
Save xaviervia/565475b0bddbfaff5f2bc3e890a93638 to your computer and use it in GitHub Desktop.
const buttonLayout = createLayoutStyles({
spacing: {
top: 0,
bottom: 0,
left: 0,
right,
},
size: {
height: 500,
width: 300,
},
border: {
left: {
radius: 5,
width: 1,
style: 'solid',
color: '#FFF'
},
right: {
...
}
},
background: {
color: 'green',
url: 'http://google.com/'
},
content: {
direction: 'vertical',
align: {
horizontal: 'center' / 'top' / 'bottom',
vertical: 'center' / 'left' / 'right',
},
space: 'around' / 'between',
justify: true ('justifyContent: space-between'),
wrap: true,
reverse: true,
grow: true,
shrink: true,
}
})
const buttonText = createTextStyles({
family: 'Helvetica',
size: 16,
lineHeight: 30,
weight: 400,
letterSpacing: 3,
color: 'red'
})
@deepsweet
Copy link

font: {
  family: '',
  size: 16,
  weight: 'normal' / 'bold' / 100 / 200 / 300 / 400 / 500 / 600 / 700 / 800 / 900
},
italic: true

@deepsweet
Copy link

selection: false

@deepsweet
Copy link

Another idea to discuss: prefix all boolean props with has/is/can, something like canGrow: true or isVisible: false.

@xaviervia
Copy link
Author

dangerouslyInjectUnsupportedStyles: { __: { WebkitFontSmoothing: 20 } }

@xaviervia
Copy link
Author

For server side rendering, we can mark the required keys with $.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment