-
Notifications
You must be signed in to change notification settings - Fork 336
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
/deep/ selector #57
Comments
I already encountered this issue, I think. Tell me if we are talking about the same thing. You use I personally, from this point, decided not to use Summary:
|
Hello @adrianoresende Please be free to call friends to post their opinion on this topic. If they really like it, let's write a style guide. :D |
The only reason I used scope is to avoid side effects. Everyone has already had side effect with CSS in maintenance or improvement, so CSS enclosed inside component makes it safer. I'm interested to know the best way to apply style safely and less complexity (less side effect) |
@adrianoresende You would agree that all the components of an application should have a different name? Well I personally add the name of the component as class root, so no risk of any collision. If there is a collision, you used a class of the name of another component. Example: <template>
<div class="task-board">
<!-- ... -->
</div>
</template>
<script></script>
<style>
.task-board {
// ...
}
</style> Or <template>
<div class="users-list">
<!-- ... -->
</div>
</template>
<script></script>
<style>
.users-list {
// ...
}
</style> That's how I work. |
@Elfayer this approach has a downside. If you do something like below: <template>
<div class="table-component">
<h1 class="title">My awesome table</h1>
<row-component></row-component>
</div>
</template>
<style>
.table-component .title {
font-weight: bold;
}
</style> If the As I see it, not using |
But back to the main topic, overall what do you folks think of using Using it you are coupling the style from the children to the parent, but on the other side it reduces some complexity on some cases 🤔 I feel like if you don't overuse it, |
|
Very good the guide.
I would like to know your opinions about
/deep/ selector
.It turns out that the father needs a change in the child only in the visual. I do not know if this violates FIRST.
This feature is implemented in 12.2.0 (vue-loader) May 2017
Issue: vuejs/vue-loader#661
I like this feature because it avoids increasing the code in the child components.
For example, create a
props
in the child just to increase the space (margin/padding) instyle inline
and then one moreprops
to change other styles. It does not sound good to me./deep/ selector example:
The text was updated successfully, but these errors were encountered: