CONTRIBUTOR-DOCS / Project planning / Components / Link / Link migration roadmap
In this doc
CSS selectors
Base component:
.spectrum-Link
Variants:
.spectrum-Link--inline.spectrum-Link--quiet.spectrum-Link--secondary.spectrum-Link--staticBlack.spectrum-Link--staticWhite
States:
.spectrum-Link:active.spectrum-Link:focus-visible.spectrum-Link:hover.spectrum-Link--quiet:hover
Language-specific:
.spectrum-Link:lang(ja).spectrum-Link:lang(ko).spectrum-Link:lang(zh)
Passthroughs
None found for this component.
Modifiers
--mod-link-animation-duration--mod-link-inline-font-weight--mod-link-line-height-cjk--mod-link-text-color--mod-link-text-color-active--mod-link-text-color-black--mod-link-text-color-focus--mod-link-text-color-hover--mod-link-text-color-secondary-active--mod-link-text-color-secondary-default--mod-link-text-color-secondary-focus--mod-link-text-color-secondary-hover--mod-link-text-color-white
Attributes
variant- Values:secondarystatic-color- Values:black,whitequiet- Boolean attribute
From LikeAnchor mixin:
download- String attributelabel- String attribute (aria-label)href- String attributetarget- Values:_blank,_parent,_self,_topreferrerpolicy- Values:no-referrer,no-referrer-when-downgrade,origin,origin-when-cross-origin,same-origin,strict-origin,strict-origin-when-cross-origin,unsafe-urlrel- String attribute
From Focusable mixin:
autofocus- Boolean attributedisabled- Boolean attributetabIndex- Number attribute
Slots
- Default slot - Link text content
Spectrum Web Components:
<a
id="anchor"
href="[href]"
download="[download]"
target="[target]"
aria-label="[label]"
tabindex="[tabindex]"
referrerpolicy="[referrerpolicy]"
rel="[rel]"
>
<slot></slot>
</a>Legacy (CSS main branch):
<a
class="spectrum-Link
spectrum-Link--quiet
spectrum-Link--[variant]
spectrum-Link--static[StaticColor]"
id="[id]"
href="[url]"
>
[label]
</a>Spectrum 2 (CSS spectrum-two branch):
<a
class="spectrum-Link
spectrum-Link--quiet
spectrum-Link--inline
spectrum-Link--[variant]
spectrum-Link--static[StaticColor]"
id="[id]"
href="[url]"
>
[text]
</a>Diff: Legacy (CSS main) → Spectrum 2 (CSS spectrum-two)
--- Legacy DOM structure
+++ Spectrum 2 DOM structure
@@ -1,14 +1,15 @@
<a
class="spectrum-Link
spectrum-Link--quiet
+ spectrum-Link--inline
spectrum-Link--[variant]
spectrum-Link--static[StaticColor]"
id="[id]"
href="[url]"
>
- [label]
+ [text]
</a>Key changes:
- New variant:
spectrum-Link--inlineclass added for inline link styling
| CSS selector | Attribute or slot | Status |
|---|---|---|
.spectrum-Link |
:host |
Implemented |
.spectrum-Link--inline |
Missing from WC (new for S2) | |
.spectrum-Link--quiet |
quiet |
Implemented |
.spectrum-Link--secondary |
variant="secondary" |
Implemented |
.spectrum-Link--staticBlack |
static-color="black" |
Implemented |
.spectrum-Link--staticWhite |
static-color="white" |
Implemented |
.spectrum-Link:hover |
CSS :hover |
Implemented via CSS |
.spectrum-Link:active |
CSS :active |
Implemented via CSS |
.spectrum-Link:focus-visible |
CSS :focus |
Implemented via CSS |
.spectrum-Link--quiet:hover |
CSS :hover |
Implemented via CSS |
.spectrum-Link:lang(ja), .spectrum-Link:lang(ko), .spectrum-Link:lang(zh) |
Language-specific styling | Implemented |
| text content | Default slot | Implemented |
Missing from WC:
.spectrum-Link--inline- New modifier for inline link styling
The inline link variant is the default style in S2. The modifier was added in Spectrum 2 to support inline links within paragraphs that have different styling requirements than standalone links (specifically for text decoration and font-weight behavior). This standalone variant, the previous default, is still the available as a variant option.
No structural changes to core Link component