Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

BREAKING: apply styles prop to the root element #238

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Sep 15, 2018

Before

The styles prop accepted a map of component slots to styles:

<Button 
  styles={{ 
    root: { background: 'blue' },
    icon: { color: 'white' },
   }}
  icon='user'
/>

After

The styles prop now styles the root element only. Use shorthand props to style component slots:

<Button
  styles={{ background: 'blue' }}
  icon={{ name: 'user', styles: { color: 'white' } }}
/>

@levithomason levithomason changed the title feat: apply styles prop to the root element BREAKING: apply styles prop to the root element Sep 15, 2018
@levithomason levithomason force-pushed the feat/root-styles branch 2 times, most recently from 033e7d9 to 63a8721 Compare September 15, 2018 18:52
root: props.styles,
},
)
const accessibility: Accessibility = getAccessibility(stateAndProps, actionHandlers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

expect(shorthandComponentProps.styles).toBeDefined()
expect(shorthandComponentProps.styles.root).toEqual({ foo: 'bar' })
})

test(`shorthand's variables may be passed as '${shorthandPropertyName}' prop of ${
Copy link
Contributor

@kuzhelov kuzhelov Sep 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, in that case we should seriously think about this variables guy as well..

@brianespinosa brianespinosa mentioned this pull request Sep 17, 2018
9 tasks
@levithomason levithomason merged commit 5db6547 into master Sep 19, 2018
@levithomason levithomason deleted the feat/root-styles branch September 19, 2018 15:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants