Skip to content

Commit 33fd963

Browse files
Polish announcement dismiss button
1 parent 3c28652 commit 33fd963

2 files changed

Lines changed: 35 additions & 11 deletions

File tree

_includes/header.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
{{ site.data.header.announcement.link_text }}
1616
</a>
1717
</div>
18-
<button class="announcement-dismiss" type="button" aria-label="Dismiss announcement">X</button>
18+
<button class="announcement-dismiss" type="button" aria-label="Dismiss announcement">
19+
<span aria-hidden="true"></span>
20+
</button>
1921
</div>
2022
</div>
2123
</div>

assets/styles.css

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ body, html {
252252
gap: 0.75rem;
253253
justify-content: center;
254254
min-height: 2.5rem;
255-
padding: 0.35rem 2rem;
255+
padding: 0.35rem 1.5rem;
256256
position: relative;
257257
text-align: center;
258258
}
@@ -270,25 +270,47 @@ body, html {
270270
align-items: center;
271271
background: transparent;
272272
border: 0;
273-
color: #2c573e;
274273
cursor: pointer;
275274
display: inline-flex;
276-
font: inherit;
277-
font-size: 1rem;
278-
height: 1.75rem;
275+
height: 1.25rem;
279276
justify-content: center;
280-
line-height: 1;
281277
padding: 0;
282278
position: absolute;
283-
right: 0.25rem;
279+
right: 0;
284280
top: 50%;
285281
transform: translateY(-50%);
286-
width: 1.75rem;
282+
width: 1.25rem;
283+
}
284+
285+
.announcement-dismiss span,
286+
.announcement-dismiss span::before {
287+
background-color: rgba(44, 87, 62, 0.55);
288+
border-radius: 999px;
289+
content: "";
290+
display: block;
291+
height: 1px;
292+
position: absolute;
293+
width: 0.75rem;
294+
}
295+
296+
.announcement-dismiss span {
297+
transform: rotate(45deg);
298+
}
299+
300+
.announcement-dismiss span::before {
301+
transform: rotate(90deg);
302+
}
303+
304+
.announcement-dismiss:hover span,
305+
.announcement-dismiss:hover span::before,
306+
.announcement-dismiss:focus span,
307+
.announcement-dismiss:focus span::before {
308+
background-color: #2c573e;
287309
}
288310

289-
.announcement-dismiss:hover,
290311
.announcement-dismiss:focus {
291-
color: #0069ff;
312+
outline: 1px solid rgba(44, 87, 62, 0.35);
313+
outline-offset: 2px;
292314
}
293315

294316
.wip {

0 commit comments

Comments
 (0)