Skip to content

Instantly share code, notes, and snippets.

@lega911
Created September 28, 2020 18:51
Show Gist options
  • Save lega911/df8f752ffdbd5531b2ff9449d93a186b to your computer and use it in GitHub Desktop.
Save lega911/df8f752ffdbd5531b2ff9449d93a186b to your computer and use it in GitHub Desktop.
Property $class
<script>
import Child from './Child.xht';
let cond = true;
</script>
<input type="checkbox" :checked={cond} />
<Child class="red italic" class:bold={cond} />
<style>
.red {color: red;}
.italic {font-style: italic;}
.bold {font-weight: bold;}
</style>
<div class={$class}>
Child
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment