Skip to content

Commit

Permalink
Set phase banner width to 100% on desktop
Browse files Browse the repository at this point in the history
On most pages (apart from the homepage), the parent div (`.app-pane`)
is a flex container. We used to wrap the phase banner in a `div` but
removed this in alphagov@a04885b
as the class being applied to that `div` was only being used for tests.

Unfortunately, removing the `div` had the side effect of changing the
positioning of the phase banner when it was inside the flex container -
the phase banner appeared centred on the page.

I think this is happening because it's a child item of a flex container and it
doesn't have any existing properties to say how much space it should take up, so it's
only taking up the space it needs rather than the full width.

This commit sets `width: 100%;` on the phase banner on desktop so that it's centered correctly.
  • Loading branch information
Vanita Barrett committed Nov 26, 2021
1 parent dc4b37c commit 6c83fde
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/stylesheets/components/_phase-banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
}

@include govuk-media-query($from: tablet) {
width: 100%;
border-bottom: 0;
}
}
Expand Down

0 comments on commit 6c83fde

Please sign in to comment.