Skip to content

Commit

Permalink
Use component wrapper on skip link component
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGDS committed Jan 6, 2025
1 parent 039d37a commit 639c679
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Use govuk-spacing for highlight answer govspeak component ([PR #4515](https://github.com/alphagov/govuk_publishing_components/pull/4515))
* Add context option to heading component ([PR #4510](https://github.com/alphagov/govuk_publishing_components/pull/4510))
* Add option for organisation logos to hide the link underline until it's hovered ([PR #4509](https://github.com/alphagov/govuk_publishing_components/pull/4509))
* Use component wrapper on skip link component ([PR #4520](https://github.com/alphagov/govuk_publishing_components/pull/4520))

## 46.4.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@

href ||= '#main-content'
text ||= t('components.skip_link.text')

component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class("gem-c-skip-link govuk-skip-link govuk-!-display-none-print")
component_helper.add_data_attribute({ module: "govuk-skip-link" })

%>
<%= link_to(text, href, class: "gem-c-skip-link govuk-skip-link govuk-!-display-none-print", data: { module: "govuk-skip-link" }) %>
<%= link_to(text, href, **component_helper.all_attributes) %>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ accessibility_criteria: |
- is the first items that screen readers hear and that keyboard users tab to
accessibility_excluded_rules:
- skip-link # This component is creating a reference to #content which is part of the layout
uses_component_wrapper_helper: true
examples:
default:
data:
Expand Down

0 comments on commit 639c679

Please sign in to comment.