react-scoped-css
react-scoped-css copied to clipboard
Not applying effect in components
Has some way to apply effect in my external components imported in a file with scope?
example:
import 'style.scoped.sass'
import Component from 'component'
export default function foo() {
return (
<Component className="class_from_style_scoped" />
)
}
Thanks :)
There are two ways to achieve this:
- use the
/deep/
selector - If you can control the impl of Component, let it pass down the data-v-{hash} prop, then the scoped style will take effect
@gaoxiaoliangz is there any way to skip hash?
I have something like this and I don't want it to be hashed
.parent .child {
....
}
My case is I concatenate two values => className=parent parent--${customClassname}