Skip to content

Instantly share code, notes, and snippets.

@lega911
Created September 28, 2020 22:17
Show Gist options
  • Save lega911/8943e3b6ce77ce38125072033e7e6560 to your computer and use it in GitHub Desktop.
Save lega911/8943e3b6ce77ce38125072033e7e6560 to your computer and use it in GitHub Desktop.
Attach a class
<script>
import Button from './Button.xht';
</script>
<h1>Pass class</h1>
<Button name="Red" class="btn" />
<Button name="Default" />
<style>
.btn {color: red;}
h1 {color: brown;}
</style>
<script>
export let name;
</script>
<button class="btn">{name}</button>
<style>
.btn {font-style: italic;}
:export(.btn) {color: deepskyblue;}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment