SU-SWS/decanter

View on GitHub
core/src/templates/components/skiplinks/target.twig

Summary

Maintainability
Test Coverage
{#
/**
 * Skip Links Component
 * Target element
 *
 * The target element of the Skip Links component should be included at the very top of your pages' main content,
 * after the nav and other header elements.
 *
 * Available variables:
 * - target_id: The id of the element in the page to skip to, which must match the href
 *   of the <a> in _link.twig - defaults to 'su-main-content-1891'
 * - target_text: The text to be read by the screenreader when the user clicks the
 *   skiplink - defaults to 'Main Content'
 */
#}
<h2 {{ attributes }} id="{{ target_id|default('su-main-content-1891') }}" class="su-sr-only-element {{ modifier_class }}" tabindex="-1">{{ target_text|default('Main Content') }}</h2>