-
Notifications
You must be signed in to change notification settings - Fork 347
Description
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)
- Operating system: N/A
- Browser: N/A
- Browser version: N/A
- GOV.UK Frontend Version: current (v5.6)


