Skip to content

Instantly share code, notes, and snippets.

@lega911
Last active October 28, 2020 21:43
Show Gist options
  • Save lega911/065441c1187bfd9ce5f0117b7dbd97f6 to your computer and use it in GitHub Desktop.
Save lega911/065441c1187bfd9ce5f0117b7dbd97f6 to your computer and use it in GitHub Desktop.
Example: passing class v2
<script>
import Icon from './Icon.xht';
let name = 'world';
</script>
<Icon />
<Icon class="green bold" />
<br/>
<Icon class="aqua big" />
<style>
.aqua {
stroke: cornflowerblue;
fill: aqua;
}
.green {
fill: lightgreen;
stroke: darkgreen;
}
.bold {
stroke-width: 8;
}
.big {
width: 200px;
height: 200px;
}
</style>
<svg class="main" width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<path d="M 10,30
A 20,20 0,0,1 50,30
A 20,20 0,0,1 90,30
Q 90,60 50,90
Q 10,60 10,30 z" />
</svg>
<style external>
.main {
stroke: red;
fill: hotpink;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment