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

Added margin top to lists. Fixes issue #5626 #5721

Merged
merged 1 commit into from Mar 21, 2015
Merged

Added margin top to lists. Fixes issue #5626 #5721

merged 1 commit into from Mar 21, 2015

Conversation

sam09
Copy link
Contributor

@sam09 sam09 commented Mar 2, 2015

This offers an alternative to #5627

@jhass
Copy link
Member

jhass commented Mar 2, 2015

Before

After

As said in #5627 (comment), I would prefer to not have a top margin at the top there, only between two elements of the post.

@sam09
Copy link
Contributor Author

sam09 commented Mar 2, 2015

I think this would fix it.

@jhass
Copy link
Member

jhass commented Mar 2, 2015

That doesn't seem to solve the original issue, right?

I also don't like the added indent tbh, it looks odd to me, especially if there's nothing else in the post.

@sam09
Copy link
Contributor Author

sam09 commented Mar 2, 2015

I guess added indent is a bit odd.
As for original issue, isn't it supposed to add a margin to list if its not the first element ? Or, is it supposed to add no margin at all?

@jhass
Copy link
Member

jhass commented Mar 2, 2015

I think the desired scheme is

---------------------------------------------------------------------
<no margin>
<element>
<no margin>
---------------------------------------------------------------------
<no margin>
<element>
<margin>
<element>
<no margin>
---------------------------------------------------------------------
<no margin>
<element>
<margin>
<element>
<margin>
<element>
<no margin>
---------------------------------------------------------------------

@sam09
Copy link
Contributor Author

sam09 commented Mar 4, 2015

@jhass please have a look.

@jhass
Copy link
Member

jhass commented Mar 4, 2015

Still has the top margin if the list is the first item in the post:

I start to wonder whether you actually have a local test install and try your changes out?

@svbergerem
Copy link
Member

@sam09 I think all you have to do is setting the margin-bottom to 0 for ul and ol that are the 4th last child.

@sam09
Copy link
Contributor Author

sam09 commented Mar 16, 2015

What about the case when the list is the only element in the post.

list2

@sam09
Copy link
Contributor Author

sam09 commented Mar 16, 2015

The case when list is the only element in post is a special case of the element being first child and the fourth last child.

@svbergerem
Copy link
Member

Ah, ok. Just saw @jhass's comment where he asked for an extra margin top for lists. You set all four margin values (top, right, bottom, left) in this PR which is not necessary. Instead your code could look cleaner if you would

  1. set top and bottom margin for ul and ol
  2. remove the top margin for ul and ol if it is the first child
  3. remove the bottom margin for ul and ol if it is the 4th last child

@svbergerem
Copy link
Member

Alright @sam09, could you please squash the commits? Then I will merge this PR.

@sam09
Copy link
Contributor Author

sam09 commented Mar 20, 2015

@svbergerem Is it fine?

@svbergerem
Copy link
Member

You added left-margin: 25px. (at least I didn't see that before) Bootstrap already does that for us so there is no need to add it. While removing that line I think you could even refactor your code like this:

ul, ol {
  margin-top:0.8em;
  margin-bottom:0.8em;
  &:first-child { margin-top: 0; }
  &:nth-last-child(4) { margin-bottom: 0; }
}

After you changed that you can update your existing commit with

git commit --amend app/assets/stylesheets/stream_element.scss

@svbergerem svbergerem added this to the next-major milestone Mar 21, 2015
@svbergerem svbergerem merged commit af410ef into diaspora:develop Mar 21, 2015
svbergerem pushed a commit that referenced this pull request Mar 21, 2015
Added margin top to lists. Fixes issue #5626
@svbergerem
Copy link
Member

Thank you!

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.

None yet

3 participants