Skip Link
A "Skip to main content" link that appears when a keyboard user tabs onto it and moves focus into the main content.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
href | string | — | Fragment of the element to move focus to, such as #main. Without one the link targets the page's first
<main> element. |
Slots
| Name | Description |
|---|---|
(default) | Link text. Defaults to the translatable "Skip to main content". |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
link | The native <a> element. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-skip-link--position | position | fixed | absolute places it against a positioned ancestor instead of the viewport. |
--c2-skip-link--top | pixel | 8px | |
--c2-skip-link--inset-inline-start | pixel | 8px | |
--c2-skip-link--z-index | number | 1000 | |
--c2-skip-link--padding | padding | 8px 16px | |
--c2-skip-link--background-color | color | rgb(2, 101, 220) | |
--c2-skip-link--color | color | #ffffff | |
--c2-skip-link--border | border | none | |
--c2-skip-link--border-radius | border-radius | 6px | |
--c2-skip-link--box-shadow | box-shadow | 0 8px 24px rgba(24, 24, 27, 0.08) | |
--c2-skip-link--font-family | font-family | inherit | |
--c2-skip-link--font-size | font-size | 14px | |
--c2-skip-link--font-weight | font-weight | 600 | |
--c2-skip-link--text-decoration | text-decoration | none | |
--c2-skip-link--transition-duration | time | 150ms | How long the link takes to slide in. |
--c2-skip-link__focus--outline | outline | 2px solid rgba(2, 101, 220, 0.4) | |
--c2-skip-link__focus--outline-offset | pixel | 2px | |
Text and languages
The text the component shows, in English. It shows another language when the app adds one with addTranslations, under skip-link, and the nearest lang asks for it; any message not translated stays in English. {0}, {1}… stand for the values a message carries. Languages guide.
| Key | English | Values |
|---|---|---|
label | Skip to main content | — |