Created
May 15, 2021 21:48
-
-
Save lega911/10f9c9b24e3dadf4add73c62e242a1b7 to your computer and use it in GitHub Desktop.
Passing class to component
This file contains hidden or 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 Box from './Box.xht'; | |
</script> | |
<Box class="purple">Purple class</Box> | |
<Box class="green">Green</Box> | |
<style> | |
.purple { | |
background: rebeccapurple; | |
width: 8rem; | |
color: white; | |
} | |
.purple:hover { | |
background: #b7a8c6; | |
width: 8rem; | |
color: black; | |
} | |
.green { | |
background: lightseagreen; | |
width: 4rem; | |
color: white; | |
} | |
</style> |
This file contains hidden or 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
<div class="main"> | |
<slot>Hello</slot> | |
</div> | |
<style> | |
.main { | |
margin: 1rem; | |
padding: 0.4rem; | |
} | |
</style> | |
<style external> | |
.main { | |
background: red; | |
width: 4rem; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment