@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
352 lines (342 loc) • 14.4 kB
CSS
/*
* Anchor
*
*/
/*
* Anchor mixins
*
*/
/*
* Utilities
*/
button.dnb-anchor {
cursor: pointer;
line-height: calc(var(--line-height-basis) + 0.125rem);
border: none;
background: none;
-webkit-appearance: none;
appearance: none;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor {
--anchor-underline-thickness: 0.0938rem;
--anchor-icon-gutter: 0.25em;
--anchor-icon-separator: '\2060';
--anchor-icon-position: translateY(-0.175em);
display: inline;
padding: 0.05575em 0;
font-size: var(--font-size-basis);
-webkit-text-decoration: underline;
text-decoration: underline;
text-decoration-color: currentcolor;
text-decoration-thickness: var(--anchor-underline-thickness);
text-underline-offset: 0.25em;
border-radius: 0;
}
sup :where(:not(.dnb-anchor--no-style)).dnb-anchor, sub :where(:not(.dnb-anchor--no-style)).dnb-anchor {
padding: 0 0.025em;
}
.dnb-p :where(:not(.dnb-anchor--no-style)).dnb-anchor, .dnb-lead :where(:not(.dnb-anchor--no-style)).dnb-anchor, .dnb-h--xx-large :where(:not(.dnb-anchor--no-style)).dnb-anchor, .dnb-h--x-large :where(:not(.dnb-anchor--no-style)).dnb-anchor, .dnb-h--large :where(:not(.dnb-anchor--no-style)).dnb-anchor, .dnb-h--medium :where(:not(.dnb-anchor--no-style)).dnb-anchor, .dnb-h--basis :where(:not(.dnb-anchor--no-style)).dnb-anchor, .dnb-h--small :where(:not(.dnb-anchor--no-style)).dnb-anchor, .dnb-h--x-small :where(:not(.dnb-anchor--no-style)).dnb-anchor {
font-size: inherit;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:focus-visible {
background-color: transparent;
transition: none;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:focus-visible, .dnb-section :where(:not(.dnb-anchor--no-style)).dnb-anchor:focus-visible.dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:focus-visible {
outline: none;
--border-color: var(--focus-ring-color);
--border-width: var(--focus-ring-width);
box-shadow: 0 0 0 var(--border-width) var(--border-color);
border-color: transparent;
border-radius: 0.25em;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:hover:where(:not(.dnb-anchor--no-hover)) {
border-radius: 0.25em;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:hover:where(:not(.dnb-anchor--no-hover)), .dnb-section :where(:not(.dnb-anchor--no-style)).dnb-anchor:hover:where(:not(.dnb-anchor--no-hover)).dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:hover:not(.dnb-anchor--no-hover) {
/* stylelint-disable-next-line scss/operator-no-unspaced */
}
@supports not (selector(*:where(*))) {
:where(:not(.dnb-anchor--no-style)).dnb-anchor:hover:not(.dnb-anchor--no-hover) {
border-radius: 0.25em;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:hover:not(.dnb-anchor--no-hover), .dnb-section :where(:not(.dnb-anchor--no-style)).dnb-anchor:hover:not(.dnb-anchor--no-hover).dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:active {
border-radius: 0.25em;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor:active, .dnb-section :where(:not(.dnb-anchor--no-style)).dnb-anchor:active.dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor {
transition: box-shadow 200ms ease-in-out, border-radius 200ms ease-in-out, background 200ms ease-in-out;
}
[data-visual-test-wrapper] :where(:not(.dnb-anchor--no-style)).dnb-anchor {
transition: none;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor .dnb-icon {
display: inline;
vertical-align: middle;
white-space: nowrap;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor .dnb-icon svg {
vertical-align: baseline;
transform: scale(2) var(--anchor-icon-position);
font-size: 0.5em;
width: 2em;
height: 1em;
pointer-events: none;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor--no-icon .dnb-icon {
display: none;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor--icon-left .dnb-icon:first-child::after {
content: var(--anchor-icon-separator);
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor--icon-left .dnb-icon:first-child svg {
margin-right: calc(var(--anchor-icon-gutter) * 2);
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor--icon-right .dnb-icon:last-child::before {
content: var(--anchor-icon-separator);
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor--icon-right .dnb-icon:last-child svg {
margin-left: calc(var(--anchor-icon-gutter) * 2);
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor .dnb-icon--default {
font-size: 0.8888888889em;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor.dnb-anchor--contrast {
color: var(--color-white);
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor.dnb-anchor--contrast:hover:where(:not(.dnb-anchor--no-hover)) {
color: var(--anchor-color--contrast);
box-shadow: inset 100vw 100vw 0 0 var(--color-white), calc(var(--anchor-background-gutter-left, 0.125rem) * -1) 0 0 0 var(--color-white), var(--anchor-background-gutter-right, 0.125rem) 0 0 0 var(--color-white);
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor.dnb-anchor--contrast:hover:not(.dnb-anchor--no-hover) {
/* stylelint-disable-next-line scss/operator-no-unspaced */
}
@supports not (selector(*:where(*))) {
:where(:not(.dnb-anchor--no-style)).dnb-anchor.dnb-anchor--contrast:hover:not(.dnb-anchor--no-hover) {
color: var(--anchor-color--contrast);
box-shadow: inset 100vw 100vw 0 0 var(--color-white), calc(var(--anchor-background-gutter-left, 0.125rem) * -1) 0 0 0 var(--color-white), var(--anchor-background-gutter-right, 0.125rem) 0 0 0 var(--color-white);
}
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor.dnb-anchor--contrast:active {
color: var(--color-white);
background-color: transparent;
box-shadow: inset 100vw 100vw 0 0 transparent, calc(var(--anchor-background-gutter-left, 0.125rem) * -1) 0 0 0 transparent, var(--anchor-background-gutter-right, 0.125rem) 0 0 0 transparent;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor.dnb-anchor--contrast:focus-visible {
color: var(--color-white);
background-color: transparent;
outline: none;
--border-color: var(--color-white);
--border-width: var(--focus-ring-width);
box-shadow: 0 0 0 var(--border-width) var(--border-color);
border-color: transparent;
}
:where(:not(.dnb-anchor--no-style)).dnb-anchor.dnb-anchor--disabled, :where(:not(.dnb-anchor--no-style)).dnb-anchor[aria-disabled=true], :where(:not(.dnb-anchor--no-style)).dnb-anchor[disabled] {
color: var(--anchor-color--disabled);
}
:not(.dnb-anchor--no-style) {
/* stylelint-disable-next-line scss/operator-no-unspaced */
}
@supports not (selector(*:where(*))) {
:not(.dnb-anchor--no-style).dnb-anchor {
--anchor-underline-thickness: 0.0938rem;
--anchor-icon-gutter: 0.25em;
--anchor-icon-separator: '\2060';
--anchor-icon-position: translateY(-0.175em);
display: inline;
padding: 0.05575em 0;
font-size: var(--font-size-basis);
-webkit-text-decoration: underline;
text-decoration: underline;
text-decoration-color: currentcolor;
text-decoration-thickness: var(--anchor-underline-thickness);
text-underline-offset: 0.25em;
border-radius: 0;
}
sup :not(.dnb-anchor--no-style).dnb-anchor, sub :not(.dnb-anchor--no-style).dnb-anchor {
padding: 0 0.025em;
}
.dnb-p :not(.dnb-anchor--no-style).dnb-anchor, .dnb-lead :not(.dnb-anchor--no-style).dnb-anchor, .dnb-h--xx-large :not(.dnb-anchor--no-style).dnb-anchor, .dnb-h--x-large :not(.dnb-anchor--no-style).dnb-anchor, .dnb-h--large :not(.dnb-anchor--no-style).dnb-anchor, .dnb-h--medium :not(.dnb-anchor--no-style).dnb-anchor, .dnb-h--basis :not(.dnb-anchor--no-style).dnb-anchor, .dnb-h--small :not(.dnb-anchor--no-style).dnb-anchor, .dnb-h--x-small :not(.dnb-anchor--no-style).dnb-anchor {
font-size: inherit;
}
:not(.dnb-anchor--no-style).dnb-anchor:focus-visible {
background-color: transparent;
transition: none;
}
:not(.dnb-anchor--no-style).dnb-anchor:focus-visible, .dnb-section :not(.dnb-anchor--no-style).dnb-anchor:focus-visible.dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
:not(.dnb-anchor--no-style).dnb-anchor:focus-visible {
outline: none;
--border-color: var(--focus-ring-color);
--border-width: var(--focus-ring-width);
box-shadow: 0 0 0 var(--border-width) var(--border-color);
border-color: transparent;
border-radius: 0.25em;
}
:not(.dnb-anchor--no-style).dnb-anchor:hover:where(:not(.dnb-anchor--no-hover)) {
border-radius: 0.25em;
}
:not(.dnb-anchor--no-style).dnb-anchor:hover:where(:not(.dnb-anchor--no-hover)), .dnb-section :not(.dnb-anchor--no-style).dnb-anchor:hover:where(:not(.dnb-anchor--no-hover)).dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
:not(.dnb-anchor--no-style).dnb-anchor:hover:not(.dnb-anchor--no-hover) {
/* stylelint-disable-next-line scss/operator-no-unspaced */
}
@supports not (selector(*:where(*))) {
:not(.dnb-anchor--no-style).dnb-anchor:hover:not(.dnb-anchor--no-hover) {
border-radius: 0.25em;
}
:not(.dnb-anchor--no-style).dnb-anchor:hover:not(.dnb-anchor--no-hover), .dnb-section :not(.dnb-anchor--no-style).dnb-anchor:hover:not(.dnb-anchor--no-hover).dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
}
:not(.dnb-anchor--no-style).dnb-anchor:active {
border-radius: 0.25em;
}
:not(.dnb-anchor--no-style).dnb-anchor:active, .dnb-section :not(.dnb-anchor--no-style).dnb-anchor:active.dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
:not(.dnb-anchor--no-style).dnb-anchor {
transition: box-shadow 200ms ease-in-out, border-radius 200ms ease-in-out, background 200ms ease-in-out;
}
[data-visual-test-wrapper] :not(.dnb-anchor--no-style).dnb-anchor {
transition: none;
}
:not(.dnb-anchor--no-style).dnb-anchor .dnb-icon {
display: inline;
vertical-align: middle;
white-space: nowrap;
}
:not(.dnb-anchor--no-style).dnb-anchor .dnb-icon svg {
vertical-align: baseline;
transform: scale(2) var(--anchor-icon-position);
font-size: 0.5em;
width: 2em;
height: 1em;
pointer-events: none;
}
:not(.dnb-anchor--no-style).dnb-anchor--no-icon .dnb-icon {
display: none;
}
:not(.dnb-anchor--no-style).dnb-anchor--icon-left .dnb-icon:first-child::after {
content: var(--anchor-icon-separator);
}
:not(.dnb-anchor--no-style).dnb-anchor--icon-left .dnb-icon:first-child svg {
margin-right: calc(var(--anchor-icon-gutter) * 2);
}
:not(.dnb-anchor--no-style).dnb-anchor--icon-right .dnb-icon:last-child::before {
content: var(--anchor-icon-separator);
}
:not(.dnb-anchor--no-style).dnb-anchor--icon-right .dnb-icon:last-child svg {
margin-left: calc(var(--anchor-icon-gutter) * 2);
}
:not(.dnb-anchor--no-style).dnb-anchor .dnb-icon--default {
font-size: 0.8888888889em;
}
:not(.dnb-anchor--no-style).dnb-anchor.dnb-anchor--contrast {
color: var(--color-white);
}
:not(.dnb-anchor--no-style).dnb-anchor.dnb-anchor--contrast:hover:where(:not(.dnb-anchor--no-hover)) {
color: var(--anchor-color--contrast);
box-shadow: inset 100vw 100vw 0 0 var(--color-white), calc(var(--anchor-background-gutter-left, 0.125rem) * -1) 0 0 0 var(--color-white), var(--anchor-background-gutter-right, 0.125rem) 0 0 0 var(--color-white);
}
:not(.dnb-anchor--no-style).dnb-anchor.dnb-anchor--contrast:hover:not(.dnb-anchor--no-hover) {
/* stylelint-disable-next-line scss/operator-no-unspaced */
}
@supports not (selector(*:where(*))) {
:not(.dnb-anchor--no-style).dnb-anchor.dnb-anchor--contrast:hover:not(.dnb-anchor--no-hover) {
color: var(--anchor-color--contrast);
box-shadow: inset 100vw 100vw 0 0 var(--color-white), calc(var(--anchor-background-gutter-left, 0.125rem) * -1) 0 0 0 var(--color-white), var(--anchor-background-gutter-right, 0.125rem) 0 0 0 var(--color-white);
}
}
:not(.dnb-anchor--no-style).dnb-anchor.dnb-anchor--contrast:active {
color: var(--color-white);
background-color: transparent;
box-shadow: inset 100vw 100vw 0 0 transparent, calc(var(--anchor-background-gutter-left, 0.125rem) * -1) 0 0 0 transparent, var(--anchor-background-gutter-right, 0.125rem) 0 0 0 transparent;
}
:not(.dnb-anchor--no-style).dnb-anchor.dnb-anchor--contrast:focus-visible {
color: var(--color-white);
background-color: transparent;
outline: none;
--border-color: var(--color-white);
--border-width: var(--focus-ring-width);
box-shadow: 0 0 0 var(--border-width) var(--border-color);
border-color: transparent;
}
:not(.dnb-anchor--no-style).dnb-anchor.dnb-anchor--disabled, :not(.dnb-anchor--no-style).dnb-anchor[aria-disabled=true], :not(.dnb-anchor--no-style).dnb-anchor[disabled] {
color: var(--anchor-color--disabled);
}
}
.dnb-anchor--hover {
border-radius: 0.25em;
}
.dnb-anchor--hover, .dnb-section .dnb-anchor--hover.dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
.dnb-anchor--active {
border-radius: 0.25em;
}
.dnb-anchor--active, .dnb-section .dnb-anchor--active.dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
.dnb-anchor--focus {
background-color: transparent;
transition: none;
}
.dnb-anchor--focus, .dnb-section .dnb-anchor--focus.dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
.dnb-anchor--focus {
outline: none;
--border-color: var(--focus-ring-color);
--border-width: var(--focus-ring-width);
box-shadow: 0 0 0 var(--border-width) var(--border-color);
border-color: transparent;
border-radius: 0.25em;
}
.dnb-anchor--no-underline, .dnb-section .dnb-anchor--no-underline.dnb-anchor {
-webkit-text-decoration: none;
text-decoration: none;
}
.dnb-anchor--no-radius, .dnb-anchor--no-radius:hover, .dnb-anchor--no-radius:active, .dnb-anchor--no-radius:focus-visible {
border-radius: 0;
}
.dnb-anchor--no-animation {
transition: none;
}
a.dnb-button {
transition: none;
}
.dnb-skeleton > .dnb-anchor,
.dnb-anchor.dnb-skeleton {
-webkit-text-decoration: none;
text-decoration: none;
}
.dnb-skeleton > .dnb-anchor .dnb-icon,
.dnb-anchor.dnb-skeleton .dnb-icon {
filter: grayscale(100%) opacity(0.3);
}