Skip to content

Commit 5e11127

Browse files
committed
Updated style for <GuideSection> component
1 parent 556ccfa commit 5e11127

File tree

2 files changed

+56
-12
lines changed

2 files changed

+56
-12
lines changed

app/components/guide-section.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.title-container {
2+
align-items: center;
3+
background-color: #1C304A;
4+
display: grid;
5+
grid-gap: 0 1rem;
6+
grid-template-areas:
7+
"permalink title";
8+
grid-template-columns: auto 1fr;
9+
grid-template-rows: auto;
10+
margin-left: -2rem;
11+
padding: 1rem 2rem;
12+
width: fit-content;
13+
width: -moz-fit-content; /* Firefox */
14+
}
15+
16+
.title {
17+
color: #F1F1F1;
18+
grid-area: title;
19+
word-break: break-word;
20+
}
21+
22+
.permalink {
23+
color: #C1C1C1;
24+
grid-area: permalink;
25+
text-decoration: none;
26+
}
27+
28+
.subsection-container {
29+
margin-top: 2rem;
30+
}
31+
32+
.subsection-container ~ .subsection-container {
33+
margin-top: 3rem;
34+
}

app/components/guide-section.hbs

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,34 @@
44
as |sectionId sectionTitle|
55
}}
66
<section
7-
data-test-section={{sectionTitle}}
87
aria-labelledby={{sectionId}}
8+
data-test-section={{sectionTitle}}
99
>
10-
<h2
11-
data-test-field="Section Title"
12-
id={{sectionId}}
13-
>
14-
<a href="#{{sectionId}}" title={{sectionTitle}} class="permalink">
10+
<div local-class="title-container">
11+
<h2
12+
data-test-field="Section Title"
13+
id={{sectionId}}
14+
local-class="title"
15+
>
16+
{{sectionTitle}}
17+
</h2>
18+
19+
<a
20+
href="#{{sectionId}}"
21+
local-class="permalink"
22+
title={{sectionTitle}}
23+
>
1524
{{t "component.guide-section.section"}}
1625
</a>
17-
{{sectionTitle}}
18-
</h2>
26+
</div>
1927

2028
{{#each @section.subsections as |subsection|}}
21-
<GuideSection::Subsection
22-
@sectionId={{sectionId}}
23-
@subsection={{subsection}}
24-
/>
29+
<div local-class="subsection-container">
30+
<GuideSection::Subsection
31+
@sectionId={{sectionId}}
32+
@subsection={{subsection}}
33+
/>
34+
</div>
2535
{{/each}}
2636
</section>
2737
{{/let}}

0 commit comments

Comments
 (0)