Skip to content

Commit 3923448

Browse files
committed
feat: Add "Close Guide" button to <page-guide>
Upon clicking, this button emits a `guide-close` event with no args.
1 parent 59ea1a0 commit 3923448

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

css/page-guide.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@
1010
box-shadow: 1px 1px 10px black;
1111
}
1212

13+
.page-guide__header {
14+
display: flex;
15+
}
16+
17+
.page-guide__close-button {
18+
align-self: flex-start;
19+
background: none;
20+
border: 1px solid transparent;
21+
border-radius: 0.5rem;
22+
cursor: pointer;
23+
font-size: 1.5rem;
24+
margin-left: auto; /* Push the button to the right end */
25+
}
26+
27+
.page-guide__close-button:hover {
28+
background-color: #fff;
29+
border-color: black;
30+
}
31+
1332
.page-guide__author {
1433
font-style: italic;
1534
font-weight: bold;

index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ <h1 class="logo">RiftGuide</h1>
2626

2727
<template id="template-page-guide">
2828
<div class="page-guide">
29-
<h2 class="page-guide__title">{{guide.title}}</h2>
29+
<header class="page-guide__header">
30+
<h2 class="page-guide__title">{{guide.title}}</h2>
31+
<button
32+
class="page-guide__close-button"
33+
title="Close guide"
34+
@click="$emit('guide-close')"
35+
>
36+
<i class="fas fa-arrow-circle-left"></i>
37+
</button>
38+
</header>
3039
<address class="page-guide__author">Author: {{guide.author}}</address>
3140
<div class="page-guide__body">
3241
<section

0 commit comments

Comments
 (0)