Skip to content
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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

2nd edition update #47

wants to merge 15 commits into from

Conversation

rstacruz
Copy link
Owner

@rstacruz rstacruz commented Aug 1, 2016

Work-in-progress of a v1.4 update.

Changes

  • Components are allowed to have margins. It makes no sense to have to create a layout component every time you need a margins. I think barely anyone ever cared about the "no margins in components" rule anyway!
  • @extend will not be recommended. I'll leave a mention about it, but I'd leave the official recommendation as mixins.

Improvements & clarifications

  • Structuring your files (ITCSS)
  • Layouts
  • More examples
  • Chapter on CSS preprocessors

@mik01aj
Copy link

mik01aj commented Aug 1, 2016

  • Components are allowed to have margins. It makes no sense to have to create a layout component every time you need a margins. I think barely anyone ever cared about the "no margins in components" rule anyway!

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?...

@rstacruz
Copy link
Owner Author

rstacruz commented Aug 1, 2016

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:

image

.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?

@rstacruz
Copy link
Owner Author

rstacruz commented Aug 1, 2016

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:

image

.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?

@mik01aj
Copy link

mik01aj commented Aug 1, 2016

Exactly. I add the margins in the parent context. It makes sense, because a .section-heading would perhaps have different margin, say, in a modal.

And when I have a really generic layout component, like horizontal-slider, I use .horizontal-slider > * to match the items and set their margins. And thanks to this rule, I know I will not override any of their margins, because they shouldn't have any. But this case is pretty rare.

@rstacruz
Copy link
Owner Author

rstacruz commented Aug 1, 2016

okay, that makes sense.

@rstacruz
Copy link
Owner Author

rstacruz commented Aug 1, 2016

@mik01aj care to share some of the stuff you've built on RSCSS, as well as any anecdotes on you experience with it? :-)

@mik01aj
Copy link

mik01aj commented Aug 1, 2016

Hmm, this could make a good blog post :) I added this idea to my TODO :)

@rstacruz rstacruz changed the title v1.4 update 2nd edition update Sep 20, 2016
@mik01aj
Copy link

mik01aj commented Sep 20, 2016

Btw: the blog post is here: https://medium.com/@mik01aj/rscss-77043f4fafb1

@rstacruz
Copy link
Owner Author

Hmm, we should also include this somewhere:

https://github.com/rstacruz/stylelint-rscss

@kminek
Copy link

kminek commented May 24, 2018

i agree with @mik01aj on this. rscss should promote no-margin components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants