Skip to content

Commit 69ca4aa

Browse files
committed
fix(platform): Replace incorrect usage of <h6>
We use this quite a lot to just generically mean "heading", but this is incorrect - a h6 has to be structure below a h5, not just randomly. This PR changes this to use a different heading that makes more sense or just a div+class instead. Nothing should change visually.
1 parent f1ff80f commit 69ca4aa

File tree

10 files changed

+35
-40
lines changed

10 files changed

+35
-40
lines changed

src/components/dynamicNav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ export function DynamicNav({
171171
activeClassName="active"
172172
data-sidebar-link
173173
>
174-
<h6>{title}</h6>
174+
<strong>{title}</strong>
175175
{withChevron && <NavChevron direction={isActive ? 'down' : 'right'} />}
176176
</SmartLink>
177177
) : (
178178
<div className={headerClassName} data-sidebar-link>
179-
<h6>{title}</h6>
179+
<strong>{title}</strong>
180180
</div>
181181
);
182182

src/components/guideGrid.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export function GuideGrid({platform, className}: Props) {
2727

2828
return (
2929
<Fragment>
30-
<div className="doc-toc-title">
31-
<h6>Related Guides</h6>
32-
</div>
30+
<h2>
31+
Related Guides
32+
</h2>
3333
<ul className={className}>
3434
{currentPlatform.guides.map(guide => (
3535
<li key={guide.key}>

src/components/search/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ export function Search({
345345
>
346346
<MagicIcon className="size-6 text-[var(--sgs-color-hit-highlight)] flex-shrink-0" />
347347
<div className={styles['sgs-ai-button-content']}>
348-
<h6>
348+
<div className={styles['sgs-ai-button-heading']}>
349349
Ask Sentry about{' '}
350350
<span>{query.length > 30 ? query.slice(0, 30) + '...' : query}</span>
351-
</h6>
351+
</div>
352352
<div className={styles['sgs-ai-hint']}>
353353
Get an AI-powered answer to your question
354354
</div>

src/components/search/search.module.scss

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,6 @@
170170
padding: 0;
171171
}
172172

173-
h6 {
174-
margin-top: 0;
175-
margin-bottom: 0.25rem;
176-
font-size: 0.875rem;
177-
color: var(--sgs-color-hit-text);
178-
}
179-
180173
a {
181174
display: block;
182175
text-decoration: none;
@@ -192,6 +185,12 @@
192185
}
193186
}
194187

188+
.sgs-hit-title {
189+
margin-bottom: 0.25rem;
190+
font-size: 0.875rem;
191+
color: var(--sgs-color-hit-text);
192+
}
193+
195194
.sgs-ai {
196195
color: var(--sgs-color-hit-text);
197196
padding: 0.25rem;
@@ -214,15 +213,17 @@
214213
flex-direction: column;
215214
align-items: flex-start;
216215
flex: 1;
216+
}
217217

218-
h6 {
219-
font-size: 0.875rem;
220-
line-height: 1.25rem;
221-
margin: 0;
218+
&-heading {
219+
margin-bottom: 0.25rem;
220+
font-size: 0.875rem;
221+
color: var(--sgs-color-hit-text);
222+
line-height: 1.25rem;
223+
margin: 0;
222224

223-
span {
224-
color: var(--sgs-color-hit-highlight);
225-
}
225+
span {
226+
color: var(--sgs-color-hit-highlight);
226227
}
227228
}
228229
}

src/components/search/searchResultItems.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ export function SearchResultItems({
6767
onClick={event => onSearchResultClick({event, hit, position: index})}
6868
>
6969
{hit.title && (
70-
<h6>
70+
<div className={styles['sgs-hit-title']}>
7171
<span
7272
dangerouslySetInnerHTML={{
7373
__html: DOMPurify.sanitize(hit.title, {
7474
ALLOWED_TAGS: ['mark'],
7575
}),
7676
}}
7777
/>
78-
</h6>
78+
</div>
7979
)}
8080
{hit.text && (
8181
<span

src/components/sidebar/defaultSidebar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export function DefaultSidebar({node, path}: DefaultSidebarProps) {
4949
data-sidebar-link
5050
key={node.path}
5151
>
52-
<h6>{node.frontmatter.sidebar_title || node.frontmatter.title}</h6>
52+
<div className={styles['sidebar-link-heading']}>
53+
{node.frontmatter.sidebar_title || node.frontmatter.title}
54+
</div>
5355
</Link>
5456
{renderChildren(node.children)}
5557
</Fragment>

src/components/sidebar/platformSidebar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export function PlatformSidebar({
5353
title={`Sentry for ${(guide || platform).title}`}
5454
exclude={[`/${pathRoot}/guides/`]}
5555
headerClassName={headerClassName}
56-
withChevron
5756
/>
5857
</ul>
5958
);

src/components/sidebar/style.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@
128128
&.active {
129129
background-color: var(--brandDecoration);
130130

131-
h6 {
131+
strong {
132132
color: #fff;
133133
}
134134
}
135135

136-
h6 {
136+
strong {
137+
display: block;
137138
margin-bottom: 0;
138139
font-size: 0.8rem;
139140
text-transform: uppercase;

src/components/sidebarTableOfContents/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,7 @@ export function SidebarTableOfContents() {
188188

189189
return (
190190
<div className={styles['doc-toc']}>
191-
{!!tocItems.length && (
192-
<div className={styles['doc-toc-title']}>
193-
<h6>On this page</h6>
194-
</div>
195-
)}
191+
{!!tocItems.length && <h2 className={styles['doc-toc-title']}>On this page</h2>}
196192
<ul className={styles['section-nav']}>{recursiveRender(buildTocTree(tocItems))}</ul>
197193
</div>
198194
);

src/components/sidebarTableOfContents/style.module.scss

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,8 @@
8383
.doc-toc-title {
8484
font-weight: 500;
8585
margin-bottom: 0.25rem;
86-
87-
h6 {
88-
margin-bottom: 0;
89-
font-size: 0.8rem;
90-
text-transform: uppercase;
91-
letter-spacing: 0.2px;
92-
color: inherit;
93-
}
86+
font-size: 0.8rem;
87+
text-transform: uppercase;
88+
letter-spacing: 0.2px;
89+
color: inherit;
9490
}

0 commit comments

Comments
 (0)