-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Padding or borders on nested elements causes breakage #118
Comments
@EnMod can you show your code? |
@dmitrykiselyov Sure, will do so in about an hour once I am back at a computer. I'll edit this comment with the code. EDIT: Here's the problematic part of my Jade template when it wasn't working: nav
#content
article
#content And the offending Stylus: nav
lost-column 1/4
padding 4rem
article
lost-column 3/4
padding 4rem
nav
.wrap
#content
article
.wrap
#content nav
lost-column 1/4
.wrap
padding 4rem
article
lost-column 3/4
.wrap
padding 4rem ...this fixes the problem, and |
Do you use lost in flex-mode? If so have a look at this: #119 |
@subpixelch No flex here, but thanks for the heads up. |
They (nav and article) must have a parent (to know who is the last child and remove Jade .content
nav
#content1
article
#content2 Stylus .content
lost-utility clearfix
nav
lost-column 1/4
padding 4rem
article
lost-column 3/4
padding 4rem |
Yep, and you don't have to do lost-utility clearfix if you don't want:
Will add in the clearfix and display: flex and everything for you. Sometimes just using the utility clearfix is good, but most of the time I find myself just using the lost-center. |
why aren't you using the gutter variable. .foo
lost-center 1140px 4rem and then give margin to the children elements |
@dmitrykiselyov Apologies...I should mention that @AleksejDix I wasn't using the gutter variable like that because I didn't grasp exactly how it works just yet, and didn't think to use padstuff = 4rem
section
lost-center 100% padstuff
nav
lost-column 1/4
margin-top padstuff
article
lost-column 3/4
margin-top padstuff Thanks so much for your help, everyone. I've still got much to learn it seems :) |
Sorry I was out of town all this past week.
|
@corysimmons thank you so much! Could we put this information into Readme? (@peterramsing) I have spent around 5 hours trying to understand/fix this issue... This could be easily mitigated by having an FAQ / Gotchas section in Readme. Thx for the grid system, btw! |
A gotcha's section in the README or Wiki might be a good idea. |
@mindreframer Sorry to hear about the 5 hours on this. I'm working on getting some new documentation for Lost ASAP. I think with this and other things I've heard, it's time to spend some serious time on it and sooner than later. See #224 |
@peterramsing thanks! yeah, a real documentation is great, altough it might take couple weeks (months?) until it is decided and implemented. maybe just make a quick change in the readme for now and dont think about it anymore? your call. ;) there is no harm in doing so. |
@mindreframer I don't disagree. Will have something updated soon. |
@mindreframer I added this for the time being: https://github.com/peterramsing/lost#gotchas Thanks and feel free to provide feedback. 😄 |
After trying multiple times to pad/border elements that have been nested, the layout always ends up breaking. Is the solution to add
.wrap
s or similar to wrap everything I want to pad/border?The text was updated successfully, but these errors were encountered: