diff --git a/app/assets/stylesheets/layout/skip_to_main_content.scss b/app/assets/stylesheets/layout/skip_to_main_content.scss new file mode 100644 index 000000000..dcfc3db78 --- /dev/null +++ b/app/assets/stylesheets/layout/skip_to_main_content.scss @@ -0,0 +1,22 @@ +.skip-to-main-content { + @include grid-column-gutter; + + a { + &:not(:focus) { + @include element-invisible; + width: 0 !important; + } + + &:focus { + @include body-colors; + + $outline-size: $focus-inner-width + $focus-middle-width + $focus-outer-width; + + padding: 0.4rem; + position: absolute; + $global-left: $outline-size; + top: $outline-size; + z-index: 1000; + } + } +} diff --git a/app/components/layout/skip_to_main_content_component.html.erb b/app/components/layout/skip_to_main_content_component.html.erb new file mode 100644 index 000000000..e22492693 --- /dev/null +++ b/app/components/layout/skip_to_main_content_component.html.erb @@ -0,0 +1,3 @@ +
+ <%= link_to t("layouts.skip_to_main_content"), "#main" %> +
diff --git a/app/components/layout/skip_to_main_content_component.rb b/app/components/layout/skip_to_main_content_component.rb new file mode 100644 index 000000000..2cd600df3 --- /dev/null +++ b/app/components/layout/skip_to_main_content_component.rb @@ -0,0 +1,2 @@ +class Layout::SkipToMainContentComponent < ApplicationComponent +end diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index c84b71711..182fabd69 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -7,6 +7,7 @@ + <%= render Layout::SkipToMainContentComponent.new %> <%= render Layout::AdminHeaderComponent.new(current_user) %>