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): add component tokens #8660

19 changes: 17 additions & 2 deletions packages/calcite-components/src/components/link/link.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
/**
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-link-text-color: Specifies the text color of the component.
* @prop --calcite-link-icon-start-color: Specifies the color of the component's start position icon.
DitwanP marked this conversation as resolved.
Show resolved Hide resolved
* @prop --calcite-link-icon-end-color: Specifies the color of the component's end position icon.
*/

:host {
display: inline;
--calcite-link-text-color: var(--calcite-color-brand);
--calcite-link-icon-start-color: var(--calcite-color-brand);
--calcite-link-icon-end-color: var(--calcite-color-brand);
}

// link base
Expand All @@ -14,6 +27,7 @@
justify-center
rounded-none
border-none;
color: var(--calcite-link-text-color);
text-decoration: none;
line-height: inherit;
font-size: inherit;
Expand Down Expand Up @@ -47,17 +61,18 @@ calcite-icon {
// icon positioning and styles
:host .calcite-link--icon.icon-start {
margin-inline-end: theme("margin.2");
color: var(--calcite-link-icon-start-color);
}

:host .calcite-link--icon.icon-end {
margin-inline-start: theme("margin.2");
color: var(--calcite-link-icon-end-color);
}

:host {
span,
a {
@apply text-color-link
transition-default
@apply transition-default
relative
inline
border-none
Expand Down
10 changes: 5 additions & 5 deletions packages/calcite-components/src/demos/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

<div class="child"><calcite-link icon-start="information" class="font-size--2">Link</calcite-link><br /></div>

<div class="child"><calcite-link icon-start="information" class="font-size--2">Link</calcite-link><br /></div>
<div class="child"><calcite-link icon-end="information" class="font-size--2">Link</calcite-link><br /></div>

<div class="child">
<calcite-link icon-start="information" icon-end="information" class="font-size--2">Link</calcite-link><br />
Expand All @@ -102,7 +102,7 @@

<div class="child"><calcite-link icon-start="information" class="font-size--1">Link</calcite-link><br /></div>

<div class="child"><calcite-link icon-start="information" class="font-size--1">Link</calcite-link><br /></div>
<div class="child"><calcite-link icon-end="information" class="font-size--1">Link</calcite-link><br /></div>

<div class="child">
<calcite-link icon-start="information" icon-end="information" class="font-size--1">Link</calcite-link><br />
Expand All @@ -119,7 +119,7 @@

<div class="child"><calcite-link icon-start="information" class="font-size-0">Link</calcite-link><br /></div>

<div class="child"><calcite-link icon-start="information" class="font-size-0">Link</calcite-link><br /></div>
<div class="child"><calcite-link icon-end="information" class="font-size-0">Link</calcite-link><br /></div>

<div class="child">
<calcite-link icon-start="information" icon-end="information" class="font-size-0">Link</calcite-link><br />
Expand All @@ -136,7 +136,7 @@

<div class="child"><calcite-link icon-start="information" class="font-size-1">Link</calcite-link><br /></div>

<div class="child"><calcite-link icon-start="information" class="font-size-1">Link</calcite-link><br /></div>
<div class="child"><calcite-link icon-end="information" class="font-size-1">Link</calcite-link><br /></div>

<div class="child">
<calcite-link icon-start="information" icon-end="information" class="font-size-1">Link</calcite-link><br />
Expand All @@ -153,7 +153,7 @@

<div class="child"><calcite-link icon-start="information" class="font-size-2">Link</calcite-link><br /></div>

<div class="child"><calcite-link icon-start="information" class="font-size-2">Link</calcite-link><br /></div>
<div class="child"><calcite-link icon-end="information" class="font-size-2">Link</calcite-link><br /></div>

<div class="child">
<calcite-link icon-start="information" icon-end="information" class="font-size-2">Link</calcite-link><br />
Expand Down
Loading