You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The button component uses a 2px box shadow to provide a visual bottom border. This is used primarily instead of an actual bottom border because the other borders are already defined and this would cause a bevelling issue between the bottom and left/right borders. This means that the button component 'overhangs' by 2px at the bottom.
By default the button component has a margin bottom of 32px, which accounts for this 2px and then adds spacing in line with the spacing scale. However on GOV.UK we use the button component without bottom margin in our search filters, where it is supposed to line up with the bottom of a wrapping element. Due to this 2px of box shadow it doesn't, and we have to insert 2px of padding somewhere to account for this.
This is a very small thing, but if there were a way of preserving the look of the button while allowing it to not have this 2px of overhanging box shadow it would make integrating the button component into edge case scenarios like this a little easier.
Steps to reproduce the issue
Normal button appearance:
Button with zero margin applied to the bottom (note 2px overlap with containing element, highlighted):
Use of button in GOV.UK search (mobile view) at bottom of containing element, note slight overlap/misalign with grey left border of container:
Environment (where applicable)
Operating system: N/A
Browser: N/A
Browser version: N/A
GOV.UK Frontend Version: current (v5.6)
The text was updated successfully, but these errors were encountered:
Uh oh! @andysellick, the image you shared is missing helpful alt text. Check your issue body.
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.
Description of the issue
The button component uses a 2px box shadow to provide a visual bottom border. This is used primarily instead of an actual bottom border because the other borders are already defined and this would cause a bevelling issue between the bottom and left/right borders. This means that the button component 'overhangs' by 2px at the bottom.
By default the button component has a margin bottom of 32px, which accounts for this 2px and then adds spacing in line with the spacing scale. However on GOV.UK we use the button component without bottom margin in our search filters, where it is supposed to line up with the bottom of a wrapping element. Due to this 2px of box shadow it doesn't, and we have to insert 2px of padding somewhere to account for this.
This is a very small thing, but if there were a way of preserving the look of the button while allowing it to not have this 2px of overhanging box shadow it would make integrating the button component into edge case scenarios like this a little easier.
Steps to reproduce the issue
Normal button appearance:
Button with zero margin applied to the bottom (note 2px overlap with containing element, highlighted):
Use of button in GOV.UK search (mobile view) at bottom of containing element, note slight overlap/misalign with grey left border of container:
Environment (where applicable)
The text was updated successfully, but these errors were encountered: