Closed avesus closed 7 years ago
const style = csjs`
# some_id {
color: yellow;
}
`;
style.some_id === undefined
And so it wasn't work for me... What I miss?
Ah yes, the ID is never parsed (since it isn't a class), so it isn't scoped and is thus not provided in the returned object (that maps unscoped to scoped).
const style = csjs`
#some_id {
color: yellow;
}
#another_id, .bar {
color: green;
}
`;
Then you can render something like:
<div id="some_id">foo</div>
<div class={styles.bar}>bar</div>
Since the ID is not scoped, you can just reference that ID directly.
Thank you very much fro the explanation! Great library, I use it in production and it's the only covers all composability patterns I was dreaming about. Very modular.
Yep, you can use IDs! However, they won't be scoped (they'll just get passed through to the CSS untouched by csjs) Hope that helps 😄