Last active
August 17, 2023 18:06
-
-
Save haryantowang09/f37352ad9fc3940cbdf9a00d5c12c7b4 to your computer and use it in GitHub Desktop.
What could happen Vue CSS Scope with @import
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
/** | |
* Asnwer: | |
* @import new-style.css wrapped inside <style scope> won't make the CSS code imported become scoped | |
**/ | |
# Correct Scoped | |
<style scoped> | |
header { | |
width: 100%; | |
height: 5rem; | |
background-color: #3d008d; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} | |
# Failed Scoping | |
<style scoped> | |
@import '../../assets/header.css'; | |
</style> | |
COMMENTS | |
Now the interesting part is WHY ? | |
Let's go to stackoverflow first | |
Clues | |
https://stackoverflow.com/questions/63609445/vue-style-scoped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment