Skip to content

Rename #main to #app-main for better compatibility with content #869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
:class="{ fromkeyboard: fromKeyboard, hascustomheader: hasCustomHeader }"
>
<div :id="AppTopID" />
<a href="#main" id="skip-nav" v-if="!isTargetIDE">{{ $t('accessibility.skip-navigation') }}</a>
<a href="#app-main" id="skip-nav" v-if="!isTargetIDE">
{{ $t('accessibility.skip-navigation') }}
</a>
<slot name="header" :isTargetIDE="isTargetIDE">
<SuggestLang v-if="enablei18n" />
<!-- Render the custom header by default, if there is no content in the `header` slot -->
Expand Down
2 changes: 1 addition & 1 deletion src/components/Article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:rootReference="hierarchy.reference"
:identifierUrl="identifierUrl"
/>
<main id="main" tabindex="0">
<main id="app-main" tabindex="0">
<slot name="above-hero" />
<component
v-for="(section, index) in sections"
Expand Down
4 changes: 2 additions & 2 deletions src/components/DocumentationTopic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
>
<component
:is="isTargetIDE ? 'div' : 'main'"
class="main" id="main"
class="main" id="app-main"
>
<DocumentationHero
:role="role"
Expand Down Expand Up @@ -778,7 +778,7 @@ $space-size: 15px;
}
}

#main {
#app-main {
outline-style: none;
height: 100%;

Expand Down
2 changes: 1 addition & 1 deletion src/components/Tutorial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:rootReference="hierarchy.reference"
:identifierUrl="identifierUrl"
/>
<main id="main" tabindex="0">
<main id="app-main" tabindex="0">
<Section
v-for="(section, index) in sections"
:section="section"
Expand Down
2 changes: 1 addition & 1 deletion src/components/TutorialsOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>
{{ title }}
</Nav>
<main id="main" tabindex="0" class="main">
<main id="app-main" tabindex="0" class="main">
<div class="radial-gradient">
<slot name="above-hero" />
<Hero
Expand Down
2 changes: 1 addition & 1 deletion src/styles/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// import the current theme _base file. This file imports fonts and other global styles
@import "~theme/styles/_theme_base.scss";

#main {
#app-main {
outline-style: none;
}

Expand Down
2 changes: 1 addition & 1 deletion src/styles/base/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ button {
@media print {

body,
#main,
#app-main,
#content {
color: #000;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/App.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('App', () => {
const wrapper = createWrapper();
const skipNavigation = wrapper.find('#skip-nav');
expect(skipNavigation.text()).toBe('accessibility.skip-navigation');
expect(skipNavigation.attributes('href')).toBe('#main');
expect(skipNavigation.attributes('href')).toBe('#app-main');
});

it('exposes a header slot', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/components/DocumentationTopic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ describe('DocumentationTopic', () => {
const main = wrapper.find('main');
expect(main.exists()).toBe(true);
expect(main.classes('main')).toBe(true);
expect(main.attributes('id')).toBe('main');
expect(main.attributes('id')).toBe('app-main');
});

it('renders a <div> instead of <main> in IDE mode', () => {
Expand All @@ -293,7 +293,7 @@ describe('DocumentationTopic', () => {
expect(wrapper.find('main').exists()).toBe(false);
const div = wrapper.find('.main');
expect(div.exists()).toBe(true);
expect(div.attributes('id')).toBe('main');
expect(div.attributes('id')).toBe('app-main');
});

it('renders an aria live that tells VO users which it is the current page content', () => {
Expand Down