Skip to content

Commit a5f7c0b

Browse files
committed
Fixing centering of urls
1 parent d753874 commit a5f7c0b

File tree

4 files changed

+177
-17
lines changed

4 files changed

+177
-17
lines changed

_includes/author-profile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h3 class="author-name">
5252
{% for link in author.links %}
5353
{% include infer-icon.html link=link %}
5454
{% if icon %}
55-
<li class="author-links-horizontal">
55+
<li>
5656
<a href="{{ link.url }}" class="author-button">
5757
<i class="{{ icon }} author-button" aria-label="Access author's external link for {{ icon }}">
5858
</i>

_sass/custom/authors.scss

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
.author-button {
2-
margin-right: .2em;
3-
font-size: x-large;
4-
color: $primary-color
5-
}
6-
7-
.author-links-horizontal {
8-
display: inline-flex;
1+
.author-button {
2+
margin-right: .2em;
3+
font-size: x-large;
4+
color: $primary-color
95
}

_sass/custom/display-author-page.scss

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ article.author-page-card {
99
grid-template-columns: 300px 1fr;
1010

1111
@media (max-width: 900px) {
12-
grid-template-columns: 1fr 2fr;
12+
grid-template-columns: 1fr 2fr;
1313
}
14+
1415
// For mobile devices, we want to stack the thumbnail on top of the rest of the content
1516
// to make it easier to read.
1617
@media (max-width: 500px) {
1718
grid-template-areas:
18-
"name"
19-
"thumbnail"
20-
"."
21-
"role"
22-
"bio"
23-
"links";
19+
"name"
20+
"thumbnail"
21+
"."
22+
"role"
23+
"bio"
24+
"links";
2425
grid-template-columns: 1fr;
2526
justify-items: center;
2627
text-align: center;
@@ -59,6 +60,7 @@ article.author-page-card {
5960
font-weight: bold;
6061
font-size: 1.25em;
6162
}
63+
6264
.author-page-bio {
6365
grid-area: bio;
6466
font-weight: italic;
@@ -72,4 +74,4 @@ article.author-page-card {
7274
text-decoration: none;
7375
margin-right: 15px;
7476
display: inline-block;
75-
}
77+
}

_sass/custom/people-card.scss

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,162 @@ div.author-avatar {
4242
}
4343
}
4444

45+
.author__urls-wrapper {
46+
position: relative;
47+
display: table-cell;
48+
vertical-align: middle;
49+
font-family: $sans-serif;
50+
z-index: 20;
51+
cursor: pointer;
52+
53+
li:last-child {
54+
a {
55+
margin-bottom: 0;
56+
}
57+
}
58+
59+
.author__urls {
60+
display: none;
61+
/* Hide the list by default */
62+
flex-direction: row;
63+
/* Ensures the items are in a row */
64+
justify-content: space-between;
65+
/* Centers the list horizontally */
66+
list-style-type: none;
67+
/* Removes bullet points */
68+
padding: 0;
69+
margin: 0;
70+
71+
li {
72+
flex: 1;
73+
text-align: center;
74+
justify-content: center;
75+
}
76+
77+
}
78+
79+
@include breakpoint($large) {
80+
display: block;
81+
82+
.author__urls {
83+
display: flex;
84+
/* Show the list when in large screen */
85+
}
86+
}
87+
88+
button {
89+
position: relative;
90+
margin-bottom: 0;
91+
92+
&:before {
93+
@supports (pointer-events: none) {
94+
content: '';
95+
position: fixed;
96+
top: 0;
97+
inset-inline-start: 0;
98+
width: 100%;
99+
height: 100%;
100+
pointer-events: none;
101+
}
102+
}
103+
104+
&.open {
105+
&:before {
106+
pointer-events: auto;
107+
}
108+
}
109+
110+
@include breakpoint($large) {
111+
display: none;
112+
}
113+
}
114+
}
115+
116+
.author__urls {
117+
display: none;
118+
position: absolute;
119+
inset-inline-end: 0;
120+
margin-top: 15px;
121+
padding: 10px;
122+
list-style-type: none;
123+
border: 1px solid $border-color;
124+
border-radius: $border-radius;
125+
background: $background-color;
126+
box-shadow: 0 2px 4px 0 rgba(#000, 0.16), 0 2px 10px 0 rgba(#000, 0.12);
127+
cursor: default;
128+
129+
&.is--visible {
130+
display: block;
131+
}
132+
133+
@include breakpoint($large) {
134+
display: block;
135+
position: relative;
136+
margin: 0;
137+
padding: 0;
138+
border: 0;
139+
background: transparent;
140+
box-shadow: none;
141+
}
142+
143+
&::before {
144+
display: block;
145+
content: "";
146+
position: absolute;
147+
top: -11px;
148+
inset-inline-start: calc(50% - 10px);
149+
width: 0;
150+
border-style: solid;
151+
border-width: 0 10px 10px;
152+
border-color: $border-color transparent;
153+
z-index: 0;
154+
155+
@include breakpoint($large) {
156+
display: none;
157+
}
158+
}
159+
160+
&:after {
161+
display: block;
162+
content: "";
163+
position: absolute;
164+
top: -10px;
165+
inset-inline-start: calc(50% - 10px);
166+
width: 0;
167+
border-style: solid;
168+
border-width: 0 10px 10px;
169+
border-color: $background-color transparent;
170+
z-index: 1;
171+
172+
@include breakpoint($large) {
173+
display: none;
174+
}
175+
}
176+
177+
ul {
178+
padding: 10px;
179+
list-style-type: none;
180+
}
181+
182+
li {
183+
white-space: nowrap;
184+
}
185+
186+
a {
187+
display: block;
188+
margin-bottom: 5px;
189+
padding-block: 2px;
190+
padding-inline-end: 5px;
191+
color: inherit;
192+
font-size: $type-size-6;
193+
text-decoration: none;
194+
195+
&:hover {
196+
text-decoration: underline;
197+
}
198+
}
199+
}
200+
45201
.author-info {
46202
display: inline-block;
47203
width: max(calc(99% - 160px), calc(65% - 10px));
@@ -82,4 +238,10 @@ div.author-avatar {
82238
@media (min-width: 601px) {
83239
width: 49%;
84240
}
241+
}
242+
243+
.author-button {
244+
margin-right: .2em;
245+
font-size: x-large;
246+
color: $primary-color
85247
}

0 commit comments

Comments
 (0)