Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(link): added :part pseudo-element to component #4749

Merged
5 changes: 4 additions & 1 deletion packages/web-components/src/components/link/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import BXLink from 'carbon-web-components/es/components/link/link.js';

/**
* Link.
*
* @csspart link The link element displayed as an <a /> tag (regular link) or <p /> (disabled link)
*/
class DDSLink extends BXLink {
@query('#link')
Expand All @@ -39,7 +41,7 @@ class DDSLink extends BXLink {
protected _renderDisabledLink() {
const { _classes: classes } = this;
return html`
<p id="link" class="${classes}">${this._renderInner()}</p>
<p id="link" part="link" class="${classes}">${this._renderInner()}</p>
`;
}

Expand All @@ -64,6 +66,7 @@ class DDSLink extends BXLink {
id="link"
role="${ifNonNull(linkRole)}"
class="${classes}"
part="link"
download="${ifNonNull(download)}"
href="${ifNonNull(href)}"
hreflang="${ifNonNull(hreflang)}"
Expand Down