Skip to content

A platform for community discussion. Free, open, simple.

A11Y: do not skip heading levels in keyboard shortcut modal (#28285)

Kris234e155d3c63
diff --git a/app/assets/javascripts/discourse/app/components/modal/keyboard-shortcuts-help.hbs b/app/assets/javascripts/discourse/app/components/modal/keyboard-shortcuts-help.hbs
index 754da3d731e..432ca8db0e4 100644
--- a/app/assets/javascripts/discourse/app/components/modal/keyboard-shortcuts-help.hbs
+++ b/app/assets/javascripts/discourse/app/components/modal/keyboard-shortcuts-help.hbs
@@ -13,9 +13,9 @@
class="shortcut-category span-{{shortcutCategory.count}}
shortcut-category-{{category}}"
>
- <h4>{{i18n
+ <h2>{{i18n
(concat "keyboard_shortcuts_help." category ".title")
- }}</h4>
+ }}</h2>
<ul>
{{#each-in shortcutCategory.shortcuts as |name shortcut|}}
<li>{{html-safe shortcut}}</li>
diff --git a/app/assets/stylesheets/common/components/keyboard_shortcuts.scss b/app/assets/stylesheets/common/components/keyboard_shortcuts.scss
index c226d3deeab..425d30798a3 100644
--- a/app/assets/stylesheets/common/components/keyboard_shortcuts.scss
+++ b/app/assets/stylesheets/common/components/keyboard_shortcuts.scss
@@ -43,7 +43,8 @@
.shortcut-category {
border: 1px solid var(--primary-low);
- h4 {
+ h2 {
+ font-size: var(--font-0);
background-color: var(--primary-very-low);
padding: 0.5rem 1rem;
}