Skip to content

Instantly share code, notes, and snippets.

@iammerrick
Last active June 16, 2016 22:05
Show Gist options
  • Save iammerrick/876c971b18a48e10e424b7e6a2df8b55 to your computer and use it in GitHub Desktop.
Save iammerrick/876c971b18a48e10e424b7e6a2df8b55 to your computer and use it in GitHub Desktop.

CSS Component

.MyComponent {
  component: children;
  background-color: #000;
  
  .icon {
    background: #FF0000;
    component: icon;
  }
}

Nested CSS Creates Component

<MyComponent icon={<Icon type='user' />}>
  Hello world!
</MyComponent>

Renders HTML

<!-- CSS is classes are hashed, e.g. css modules -->
<style>
.a {
  background-color: #000;
}
.b {
  background: #FF0;
}
</style>
<div class='a'>
  Hello world!
  <div class='b'>
    <i class='icon-24-user' />
  </div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment