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

:last-child issue with margin-top (Form elements) #428

Closed
trevorsaint opened this issue Mar 21, 2017 · 5 comments · Fixed by #498
Closed

:last-child issue with margin-top (Form elements) #428

trevorsaint opened this issue Mar 21, 2017 · 5 comments · Fixed by #498

Comments

@trevorsaint
Copy link

Looks good selecting the first item or the second item.

form-ok

We have an issue when it comes to selecting the last item as shown below:

form-bad

.form-group .panel-border-narrow:last-child

This includes margin-top of 10px which causes a visual issue as shown above.

How would you expect it to work?

I would not expect the last child in this instance to have a margin top attribute.

We could target .form-group within .form-group.

You can see this here: https://govuk-elements.herokuapp.com/form-elements/example-form-elements/

@mcgoooo
Copy link

mcgoooo commented Mar 21, 2017

i believe you need to add padding-top to 0 in here
https://github.com/alphagov/govuk_elements/blob/master/public/sass/elements/_panels.scss#L52

@trevorsaint
Copy link
Author

Hi @mcgoooo I'm affraid that won't fix the issue. A little more work is involved to fix this.

@colmjude
Copy link

colmjude commented Apr 6, 2017

Hi @trevorsaint. To clarify are you saying the issue is the grey and red lines not being the same height?

@trevorsaint
Copy link
Author

Hi @colmjude this has nothing to do with the red line.

Please look at the gap from the Monthly radio upto the panel. The gap differs to that of weekly or fortnightly. It's essentially the last child.

https://govuk-elements.herokuapp.com/form-elements/example-form-elements/

Scroll to Your income. Click Weekly, Fortnightly and look at the gap from the radio upto the panel. Now click on the last item Monthly.

Hopefully you can see what I am talking about

Example:
example

@colmjude
Copy link

colmjude commented Apr 6, 2017

Thanks for clarifying, that is clear to see.

Looks like it was introduced with this commit e4f47e0 but not fully clear why from the description.

gemmaleigh added a commit that referenced this issue Jun 13, 2017
Fixes :last-child issue with margin-top (Form elements) #428
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 a pull request may close this issue.

3 participants