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

Dynamic Css Selector #2

Open
codemeasandwich opened this issue Mar 14, 2018 · 0 comments
Open

Dynamic Css Selector #2

codemeasandwich opened this issue Mar 14, 2018 · 0 comments
Labels

Comments

@codemeasandwich
Copy link
Owner

Setting the css prop on ONE element will affect all instances

  import React from 'react';
  import outline from 'react-outline'
  import { Styles } from 'react-outline'

  let styles = {
      base : {
        title:{
           base:{     background: "lightblue", color:"black" },
          "div:nth-child(even)":{  background: "darkblue" , color:"white" }
        }
      }
  }
  styles = outline(styles);

  const Title = styles.title`div`

  export default <div>
  <Styles/>
    <Title css={{"div:nth-child(even)":{color:"red"}}}>
      <div>foo</div>
      <div>bar</div>
      <div>baz</div>
    </Title>
    <Title css={{"div:nth-child(even)":{color:"green"}}}>
      <div>foo</div>
      <div>bar</div>
      <div>baz</div>
    </Title>
  </div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant