-
Notifications
You must be signed in to change notification settings - Fork 176
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
2nd edition update #47
base: main
Are you sure you want to change the base?
Conversation
Really? I find it a pretty important rule for CSS, and I follow it most of the time. It really makes sense, because the margin usually depends on the context, and not on component itself. (Padding is fine, on the other hand, because it's inside the component.) Or wait, do you mean margins inside, or outside components?... |
Ah, nice to know that. Most everyone I've seen seems to use margins on components anyway. I commonly see them in components that stack vertically like these: .section-heading { margin-top: 32px; margin-bottom: 16px; }
.section-panel { margin-top: 16px; margin-bottom: 16px; } Any thoughts on these? If they were to be implemented without margins, they'll have to be done with a parent element like... .sections-list > .section-heading { ... }
.sections-list > .section-panel { ... } Any thoughts on these? |
Ah, nice to know that. Most everyone I've seen seems to use margins on components anyway. I commonly see them in components that stack vertically like these: .section-heading { margin-top: 32px; margin-bottom: 16px; }
.section-panel { margin-top: 16px; margin-bottom: 16px; } Any thoughts on these? If they were to be implemented without margins, they'll have to be done with a parent element like... .sections-list > .section-heading { ... }
.sections-list > .section-panel { ... } Any thoughts on these @mik01aj? |
Exactly. I add the margins in the parent context. It makes sense, because a And when I have a really generic layout component, like |
okay, that makes sense. |
@mik01aj care to share some of the stuff you've built on RSCSS, as well as any anecdotes on you experience with it? :-) |
Hmm, this could make a good blog post :) I added this idea to my TODO :) |
6c5176b
to
151ed22
Compare
Btw: the blog post is here: https://medium.com/@mik01aj/rscss-77043f4fafb1 |
Hmm, we should also include this somewhere: |
i agree with @mik01aj on this. rscss should promote no-margin components. |
Work-in-progress of a v1.4 update.
Changes
@extend
will not be recommended. I'll leave a mention about it, but I'd leave the official recommendation as mixins.Improvements & clarifications