-
Notifications
You must be signed in to change notification settings - Fork 327
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
Allow creating custom width containers and using them with template #1626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really good 🙌
I've added some comments I think the only thing that's blocking is making the CHANGELOG clearer how you use the new features.
3d1c70d
to
c2266d3
Compare
b178440
to
dd95356
Compare
@@ -4,7 +4,34 @@ | |||
|
|||
### New features | |||
|
|||
#### Allow attributes to be set on `<body>` of template | |||
#### Create custom width container classes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work on the CHANGELOG, nice 👍
Default the width to `$govuk-page-width`. Default the units to pixels if no unit is specified. The mixin can be used for creating custom width container classes which can be used for setting the width of both the main page content and for the header and footer.
This is necessary for setting custom width classes to override `.govuk-width-container`. Follow the naming of header and footer which have `containerClasses` which are "Classes that can be added to the inner container, useful if you want to make the header/footer full width."
dd95356
to
1fe97a2
Compare
Set it on the template, header and footer containers. I’ve used BEM for the custom class name as it feels clearer and in the spirit of what this is doing (creating something based on the default width class), although actually nothing is being inherited from `.govuk-width-container`. There’s a difference in how the header and footer treat `.govuk-width-container`: footer hardcodes the class whereas header overrides it with `containerClasses`. As nothing is being inherited from `.govuk-width-container` don't pass it again unnecessarily, only `.govuk-width-container—wide`.
1fe97a2
to
8b8415d
Compare
This PR:
govuk-width-container
mixin to accept a width. It defaults to$govuk-page-width
so thatgovuk-width-container
class will continue to function as before. The mixin defaults to pixels if no unit is specified..govuk-width-container
by default. I called the new template optioncontainerClasses
following the naming in the header and footer which havecontainerClasses
. These are "Classes that can be added to the inner container, useful if you want to make the header/footer full width."app.scss
as doing so feels clearer and in the spirit of what this is doing (creating something based on the default width class), although actually nothing is being inherited from.govuk-width-container
. Note that there’s a difference in how the header and footer add thegovuk-width-container
class: footer hardcodes the class whereas header overrides it withcontainerClasses
. As nothing is being inherited from.govuk-width-container
I'm not passing it again unnecessarily to the header.Tested on:
🍏 Chrome
🍏 FF
🍏 IE11
🍏 IE8
Fixes #1567
Additionally, we'll be able to fix alphagov/govuk-design-system#798 when this PR is released.