Created
September 25, 2020 18:47
-
-
Save lega911/17df015f3f9dfb1ed14832de4fb97fbf to your computer and use it in GitHub Desktop.
Example how to pass CSS-class to child component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import Icon from './Icon.xht'; | |
let name = 'world'; | |
</script> | |
<Icon /> | |
<Icon .icon="green bold" /> | |
<br/> | |
<Icon .icon="aqua big" /> | |
<style> | |
.aqua { | |
stroke: cornflowerblue; | |
fill: aqua; | |
} | |
.green { | |
fill: lightgreen; | |
stroke: darkgreen; | |
} | |
.bold { | |
stroke-width: 8; | |
} | |
.big { | |
width: 200px; | |
height: 200px; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg class="icon" 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> | |
:export(.icon) { | |
stroke: red; | |
fill: hotpink; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment