Skip to content

Commit 9ece7f0

Browse files
committed
stylesheets: Refactor header imprint styles
Before this change, the containing `a` element was using a `display` of `contents`, which caused the elements to be inaccessible via the keyboard. Changing the `a` to be a simple flex item caused various other layout issues that were corrected: * `vertical-align` was set to `middle` for both the image and text, allowing them to look mostly the same as before. * Added `text-align: center` to ensure the elements are centred on mobile-sized viewports in column layout mode. * On mobile, the image remains a `block` element so that it causes a hard break in the flex grid (otherwise, on larger mobile/tablet screen sizes, it is undersized and the "Audio/Video" appears next to the logo element). On desktop, they are no longer required to be `block` elements. * Additionally, the fixed width size of the logo is now set as the `max-width`, and a `width` of `100%` is used. This allows the logo to shrink on very small viewports, such as an iPhone 11 in 2x zoom mode. The iPhone 11 @ 2x has an effective viewport of 305px, which is smaller than the 315px width and caused the logo to be cut off with the current rules. Closes: ADA-669
1 parent 91b70eb commit 9ece7f0

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

app/assets/stylesheets/includes/desktop.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@
1818
&.branding {
1919
flex-direction: row;
2020

21+
img {
22+
&.header-logo {
23+
vertical-align: middle;
24+
width: 315px;
25+
}
26+
}
27+
2128
span {
2229
&.site-name {
2330
padding-left: $margin;
24-
padding-top: $sitename-baseline-adjust;
31+
vertical-align: middle;
2532
}
2633
}
2734
}

app/assets/stylesheets/includes/main.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,16 @@ header {
6060
div {
6161
&.branding {
6262
display: flex;
63-
flex-direction: column;
64-
65-
a {
66-
display: contents;
67-
}
6863

6964
img {
7065
&.header-logo {
71-
display: block;
7266
height: 52px;
73-
width: 315px;
7467
}
7568
}
7669

7770
span {
7871
&.site-name {
7972
color: $color-site-name;
80-
display: block;
8173
font-size: $font-size-large;
8274
letter-spacing: $margin-small;
8375
text-transform: uppercase;

app/assets/stylesheets/includes/mobile.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
flex-direction: column;
1717
padding: $margin-2xl;
1818

19+
a {
20+
text-align: center;
21+
}
22+
23+
img {
24+
&.header-logo {
25+
display: block;
26+
width: 100%;
27+
max-width: 315px;
28+
}
29+
}
30+
1931
span {
2032
&.site-name {
2133
padding-left: $margin-small;

0 commit comments

Comments
 (0)