Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit fbeef5b

Browse files
Eric Jimeneznaomiblack
Eric Jimenez
authored andcommitted
fix(badge align): fix alignment of badges on all screens. Simplify logic to achieve this
1 parent d502b1f commit fbeef5b

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

public/_includes/_hero.jade

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ if current.path[4] && current.path[3] == 'api'
88
- var textFormat = 'is-standard-case'
99

1010
header(class="hero background-sky")
11-
h1(class="hero-title text-display-1 #{textFormat}") #{headerTitle}
12-
if useBadges
11+
div(class="inner-header")
12+
h1(class="hero-title text-display-1 #{textFormat}") #{headerTitle}
13+
if useBadges
1314
span(class="badges")
1415
if docType
1516
span(class="status-badge").

public/resources/css/module/_hero.scss

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ $hero-padding: ($unit * 10) ($unit * 6) ($unit * 7);
3535
screen and (max-width: $tablet-breakpoint) {
3636
height: auto;
3737
padding-top: 40px;
38-
39-
.badges {
40-
margin-top: $unit * 6;
41-
}
4238
}
4339

4440
&.is-large {
@@ -53,8 +49,18 @@ $hero-padding: ($unit * 10) ($unit * 6) ($unit * 7);
5349
}
5450
}
5551

52+
.inner-header {
53+
display: flex;
54+
justify-items: center;
55+
flex-wrap: wrap;
56+
57+
@media screen and (max-width: 599px) {
58+
margin: ($unit * 6) 0px 0px 0px;
59+
}
60+
}
61+
5662
.badges {
57-
padding-left: 8px;
63+
margin-top: 4px;
5864

5965
.status-badge {
6066
color: #0143A3;
@@ -73,10 +79,6 @@ $hero-padding: ($unit * 10) ($unit * 6) ($unit * 7);
7379
}
7480

7581
@media screen and (max-width: 599px) {
76-
.badges {
77-
margin-top: $unit;
78-
padding-left: 0;
79-
}
8082

8183
.hero-title-with-badges {
8284
margin-bottom: $unit * 2;
@@ -92,6 +94,7 @@ $hero-padding: ($unit * 10) ($unit * 6) ($unit * 7);
9294
display: inline; // title will be inline with badges
9395
text-transform: uppercase;
9496
margin: 0;
97+
margin-right: 8px;
9598
opacity: .87;
9699

97100
&.is-standard-case {
@@ -101,7 +104,8 @@ $hero-padding: ($unit * 10) ($unit * 6) ($unit * 7);
101104
@media handheld and (max-width: $phone-breakpoint),
102105
screen and (max-device-width: $phone-breakpoint),
103106
screen and (max-width: $tablet-breakpoint) {
104-
margin: ($unit * 6) 0px 0px 0px;
107+
// reduce size of api doc title on small screens, prevents cut text on long titles
108+
font-size: 28px;
105109
}
106110
}
107111

0 commit comments

Comments
 (0)