-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add margin_bottom option to component wrapper helper
- add a margin_bottom option, which accepts a number from the govuk-frontend spacing scale to set margin bottom on components. Slightly tricky as it overlaps onto another option - classes - but all we have to do is check the number, generate the right class based on the number, then add it to the end of the classes as they are passed out from all_attributes - create a new set of styles using the govuk-frontend responsive spacing scale to use with the new option. We previously used the govuk-frontend spacing override classes, but this has long been incorrect - those should be used only where an override is necessary to achieve a style - rewrite the component wrapper helper tests a little, firstly to make more specific so that we don't have to update every test now we default output a margin class, secondly to structure and group the tests a bit more logically for readability - update a trio of components that were broken by these changes, by removing their use of the shared helper for this same functionality and updating tests accordingly
- Loading branch information
1 parent
52b5260
commit 5b71b81
Showing
11 changed files
with
271 additions
and
240 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
app/assets/stylesheets/govuk_publishing_components/lib/_spacing.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// styles used to provide margin in the component wrapper helper | ||
$margins: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; | ||
|
||
@each $margin in $margins { | ||
.govuk-margin-bottom-#{$margin} { | ||
@include govuk-responsive-margin($margin, "bottom"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.