<a href="#" class="sds-link -linkNoUnderline">
{link}
</a>
<{{ eltType }}{% if eltType === "a" %} href="{{ href }}"{% endif %} class="{{ namespace }}link{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}"{% for attrKey, attr in attrs %} {{ attrKey }}="{{ attr }}"{% endfor %}>
{% if iconInlineStart %}
<span class="{{ namespace }}link__icon {{ namespace }}icon {{ namespace }}{{ iconInlineStart }}"></span>
{% endif %}
{{ text | safe }}
{% if iconInlineEnd %}
<span class="{{ namespace }}link__icon {{ namespace }}icon {{ namespace }}{{ iconInlineEnd }}"></span>
{% endif %}
</{{ eltType }}>
/* variables specific to current element */
$element-specific-variables: "";
.#{$namespace}link {
/* Save root element context for easy access if nesting is needed */
$self: &;
/* properties of current element + media queries */
@include link();
/* Pseudo Elements */
&::before {
}
&::after {
}
/*
Include elements that are linked to the current element but have to reside at the root level of the stylesheet
(e.g: keyframes)
*/
@at-root {
}
/* children - write selector in full in comments in order to facilitate search */
// link__icon
&__icon {
// follows same logic as parent
vertical-align: baseline;
position: relative;
text-decoration: none;
margin-right: var(--comp-link-inline);
&::before {
font-size: 1em;
}
* + & {
margin-right: 0;
margin-left: var(--comp-link-inline);
}
}
/* modifiers */
// link -linkHighlight
// link -linkHypertext
&.-linkHighlight,
&.-linkHypertext {
// follows same logic as base element
@include custom-prop-fallback("color", "comp-link-hypertext-text-color");
&:hover {
@media (hover: hover) {
@include custom-prop-fallback("color", "comp-link-hypertext-hovered-text-color");
}
}
}
// link -linkNoUnderline
&.-linkNoUnderline {
text-decoration: none !important;
@include custom-prop-fallback("color", "comp-link-nounderline-text-color");
&:hover {
@media (hover: hover) {
text-decoration: underline !important;
text-decoration-thickness: $border-width*2 !important;
@include custom-prop-fallback("color", "comp-link-nounderline-hovered-text-color");
}
}
}
/* random parent element */
/*
*
* Syntax : .randomParentElt & {}
*
*/
/* Pseudo Classes */
&:hover {
@media (hover: hover) {
@include custom-prop-fallback("color","comp-link-default-hovered-text-color");
}
}
&:focus-visible {
@include link-focus();
}
&:active {
}
&:focus,
&:active {
}
}