-
Notifications
You must be signed in to change notification settings - Fork 917
Support /deep/ selector #661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
looking forward to this feature ! |
👍 |
I've been encountering this issue. It would be great to have a solution, currently i just have to namespace everything, and not use scoped currently scoped puts the scoping after the last element:
It seems that a solution could be to use the :global modifier to move the scoping from the last element, further up the chain (to the root element of the child), but this seems to put the scoping in the incorrect place:
could become:
unfortunately the current output is:
|
@yyx990803 for example..
output of parent component
So my team don't use scoped attributes in all components. |
For single styles I've been using variables in css: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables, it works like a charm. For multiple styles you could use: https://tabatkins.github.io/specs/css-apply-rule/, the Polymer framework uses both and has polyfills for them (browsers are starting to support both features, but not all do so as of now.). Maybe Vue-loader could include said polyfills? |
This is now implemented in 12.2.0: https://github.com/vuejs/vue-loader/releases/tag/v12.2.0 |
awesome!
2017年5月27日 18:48,"Evan You" <notifications@github.com>写道:
… This is now implemented in 12.2.0: https://github.com/vuejs/vue-
loader/releases/tag/v12.2.0
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#661 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEsQbU5w4U_yx_jOnE6qjB1uJoFylqNRks5r9_-EgaJpZM4MGQLS>
.
|
It looks great. Does it work for |
@lucasm-iRonin yeah, but you need to use |
Great, just encountered this issue then find this fix immediately.
Compiled to =>
Works like a charm to override muse-ui badge style. 😊 |
Scss parses |
@jordyvandomselaar At least for me >>> does not work with SCSS. /deep/ is working fine though. |
I'm using scss and neither >>> or /deep/ works for me
|
Can confirm that in SCSS, >>> does not work. Using /deep/ fixes this issue. e.g. We can style a component with class name '.Another-Component' inside of our parent component with a class name of '.Filters'.
Happy coding! |
If you are using nested components (often) a "scoped" attribute is nothing. Look at following example: parent-component.vue <template>
<div class="parent-component">
<span class="label">My label</span>
<child-component/>
</div>
</template>
<style scoped>
.parent-component >>> .label {
color: red;
}
</style> child-component.vue <template>
<div class="child-component">
<span class="label">My label from nested component</span>
</div>
</template> What you think about What we can say about "scoped" attribute? Do u really use it? NO. You just adding fu***g prefix for all classes! This is dirty but we do it. So why vue-loader cant do it for us? Just add prefix for all classes if scoped attribute requested. Also we can define new directive ( <template>
<div v-class="parent-component">
<span v-class="label">My label</span>
<child-component/>
</div>
</template> output <div class="parent-component_a9uipey1">
<span class="label_a9uipey1">My label</span>
<div class="child-component">
<span class="label">My label from nested component</span>
</div>
</div> What you think? Thank you |
Still wondering why we're not using the spec for this. (Css variables, mixins) would be much easier. |
@yyx990803 Sorry for bothering you but In my case, it doesn't work as expected.
It rendered to
What I expected is:
|
@lucduong please open a separate issue with a reproduction. |
moved from vuejs/vue#4298
The text was updated successfully, but these errors were encountered: