Skip to content

Slots and scoped css #8309

Discussion options

You must be logged in to vote

You have to use the :deep() pseudo-class to apply styles to child elements of a component.

/* css/styler.css */
article.main {
  background-color: black;
}

article.main :deep(h1) {
  color: red;
}

You can find the doc about deep selectors for css in vue sfc here : https://vuejs.org/api/sfc-css-features.html#deep-selectors

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by edison1105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants