Skip to content

Instantly share code, notes, and snippets.

@joshwnj
Created October 9, 2015 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshwnj/b4e773f84e19438a3a14 to your computer and use it in GitHub Desktop.
Save joshwnj/b4e773f84e19438a3a14 to your computer and use it in GitHub Desktop.
css modules + scoped styles?
<div>
<style scoped>
& {
background: #00F;
}
span {
color #FFF;
}
.version {
font-style: italic;
}
</style>
<span>space</span>
<span>jam</span>
<span class="version">2.0</span>
</div>
becomes:
<!-- css output -->
.__abc123_root {
background: #00F;
}
.__abc123_tag--span {
color #FFF;
}
.__abc123_version {
font-style: italic;
}
<!-- html output -->
<div class="__abc123_root">
<span class="__abc123_tag--span">space</span>
<span class="__abc123_tag--span">jam</span>
<span class="__abc123_tag--span__abc123_version">2.0</span>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment