Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Plugin] Extending styles #61

Closed
robinweser opened this issue Jul 5, 2016 · 0 comments
Closed

[Plugin] Extending styles #61

robinweser opened this issue Jul 5, 2016 · 0 comments

Comments

@robinweser
Copy link
Owner

Environment: Both
Type: Feature


Description

Would be great to have a plugin which allows (conditional) style object extension.

Proposal

We could use the extend key to specify styles used to extend.

Code Example:

// basic
const baseRules = { backgroundColor: 'red' }
const rule = props => ({
  color: 'blue',
  // might support multiple objects using arrays
  extend: baseRules
})

// conditional
const rule = props => ({
  color: 'blue',
  // could also support multiple using arrays
  extend: {
    condition: props.bg === true,
    style: {
     backgroundColor: 'red' 
   }
  }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant