2025-08-22 10:12:06 +02:00
|
|
|
@mixin button-variant($context) {
|
|
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
border-radius: var(--c--components--button--border-radius--focus);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--primary {
|
|
|
|
|
background-color: var(--c--contextuals--background--semantic--#{$context}--primary);
|
|
|
|
|
color: var(--c--contextuals--content--semantic--#{$context}--on-#{$context});
|
|
|
|
|
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
box-shadow:
|
|
|
|
|
0 0 0 1px #fff,
|
|
|
|
|
0 0 0 4px var(--c--contextuals--border--semantic--#{$context}--primary);
|
|
|
|
|
}
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
background-color: var(
|
|
|
|
|
--c--contextuals--background--semantic--#{$context}--primary-hover
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
|
background-color: var(--c--contextuals--background--semantic--disabled--primary);
|
|
|
|
|
color: var(--c--contextuals--content--semantic--disabled--primary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--secondary {
|
|
|
|
|
background-color: var(--c--contextuals--background--semantic--#{$context}--secondary);
|
|
|
|
|
color: var(--c--contextuals--content--semantic--#{$context}--secondary);
|
|
|
|
|
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
box-shadow:
|
|
|
|
|
0 0 0 1px #fff,
|
|
|
|
|
0 0 0 4px var(--c--contextuals--border--semantic--#{$context}--primary);
|
|
|
|
|
}
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
background-color: var(
|
|
|
|
|
--c--contextuals--background--semantic--#{$context}--secondary-hover
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
|
background-color: var(--c--contextuals--background--semantic--disabled--secondary);
|
|
|
|
|
color: var(--c--contextuals--content--semantic--disabled--primary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--tertiary {
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
color: var(--c--contextuals--content--semantic--#{$context}--tertiary);
|
|
|
|
|
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
box-shadow:
|
|
|
|
|
0 0 0 1px #fff,
|
|
|
|
|
0 0 0 4px var(--c--contextuals--border--semantic--#{$context}--primary);
|
|
|
|
|
}
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
background-color: var(--c--contextuals--background--semantic--contextual--primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
color: var(--c--contextuals--content--semantic--disabled--primary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--bordered {
|
|
|
|
|
border: 1px solid var(--c--contextuals--border--semantic--neutral--tertiary);
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
color: var(--c--contextuals--content--semantic--#{$context}--tertiary);
|
|
|
|
|
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
box-shadow:
|
|
|
|
|
0 0 0 1px #fff,
|
|
|
|
|
0 0 0 4px var(--c--contextuals--border--semantic--#{$context}--primary);
|
|
|
|
|
}
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus-visible {
|
|
|
|
|
background-color: var(--c--contextuals--background--semantic--contextual--primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
color: var(--c--contextuals--content--semantic--disabled--primary);
|
|
|
|
|
border-color: var(--c--contextuals--border--semantic--disabled--primary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-01 12:05:08 +01:00
|
|
|
.c__button {
|
2023-01-12 17:41:14 +01:00
|
|
|
align-items: center;
|
|
|
|
|
border-radius: var(--c--components--button--border-radius);
|
2023-03-31 17:25:45 +02:00
|
|
|
border: thin solid transparent;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
cursor: pointer;
|
2023-10-18 17:38:48 +02:00
|
|
|
display: inline-flex;
|
|
|
|
|
// When button is rendered as link.
|
|
|
|
|
text-decoration: none;
|
2023-01-12 17:41:14 +01:00
|
|
|
font-weight: var(--c--components--button--font-weight);
|
2023-08-04 17:05:00 +02:00
|
|
|
font-family: var(--c--components--button--font-family);
|
2025-08-22 10:12:06 +02:00
|
|
|
transition: all var(--c--globals--transitions--duration)
|
|
|
|
|
var(--c--globals--transitions--ease-out);
|
2023-03-31 17:25:45 +02:00
|
|
|
user-select: none;
|
|
|
|
|
|
2023-09-01 17:33:15 +02:00
|
|
|
&__icon {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-20 11:01:54 +01:00
|
|
|
&--text {
|
|
|
|
|
font-weight: var(--c--components--button--text-font-weight);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-25 15:41:07 +02:00
|
|
|
&--full-width {
|
|
|
|
|
width: 100%;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-16 14:41:40 +01:00
|
|
|
&--medium {
|
|
|
|
|
height: var(--c--components--button--medium-height);
|
|
|
|
|
font-size: var(--c--components--button--medium-font-size);
|
2025-08-22 10:12:06 +02:00
|
|
|
padding: 0 var(--c--globals--spacings--s);
|
2023-02-16 14:41:40 +01:00
|
|
|
|
2023-12-20 11:01:54 +01:00
|
|
|
|
2023-02-16 14:41:40 +01:00
|
|
|
&.c__button--icon-only {
|
|
|
|
|
width: var(--c--components--button--medium-height);
|
|
|
|
|
}
|
2023-09-01 17:33:15 +02:00
|
|
|
|
2025-08-22 10:12:06 +02:00
|
|
|
.c__button__icon,
|
|
|
|
|
.c__button__icon * {
|
2023-09-01 17:33:15 +02:00
|
|
|
font-size: var(--c--components--button--medium-icon-font-size);
|
|
|
|
|
}
|
2023-02-16 14:41:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--small {
|
|
|
|
|
height: var(--c--components--button--small-height);
|
|
|
|
|
font-size: var(--c--components--button--small-font-size);
|
|
|
|
|
padding: 0 0.75rem;
|
|
|
|
|
|
|
|
|
|
&.c__button--icon-only {
|
|
|
|
|
width: var(--c--components--button--small-height);
|
|
|
|
|
}
|
2023-09-01 17:33:15 +02:00
|
|
|
|
2025-08-22 10:12:06 +02:00
|
|
|
.c__button__icon,
|
|
|
|
|
.c__button__icon * {
|
2023-09-01 17:33:15 +02:00
|
|
|
font-size: var(--c--components--button--small-icon-font-size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--nano {
|
|
|
|
|
height: var(--c--components--button--nano-height);
|
|
|
|
|
font-size: var(--c--components--button--nano-font-size);
|
|
|
|
|
padding: 0 0.5rem;
|
|
|
|
|
|
|
|
|
|
&.c__button--icon-only {
|
|
|
|
|
width: var(--c--components--button--nano-height);
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-22 10:12:06 +02:00
|
|
|
.c__button__icon,
|
|
|
|
|
.c__button__icon * {
|
2023-09-01 17:33:15 +02:00
|
|
|
font-size: var(--c--components--button--nano-icon-font-size);
|
|
|
|
|
}
|
2023-02-16 14:41:40 +01:00
|
|
|
}
|
|
|
|
|
|
2023-02-13 12:07:38 +01:00
|
|
|
&--icon-only {
|
|
|
|
|
padding: 0;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-22 10:12:06 +02:00
|
|
|
&--with-icon--left,
|
|
|
|
|
&--with-icon--right {
|
|
|
|
|
gap: var(--c--globals--spacings--xxxs);
|
2023-01-16 11:17:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--with-icon--left {
|
2025-08-22 10:12:06 +02:00
|
|
|
padding: 0 var(--c--globals--spacings--s) 0 var(--c--globals--spacings--t);
|
2023-01-16 11:17:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--with-icon--right {
|
2025-08-22 10:12:06 +02:00
|
|
|
padding: 0 var(--c--globals--spacings--t) 0 var(--c--globals--spacings--s);
|
2023-01-16 11:17:27 +01:00
|
|
|
}
|
|
|
|
|
|
2025-08-22 10:12:06 +02:00
|
|
|
&--brand {
|
|
|
|
|
@include button-variant("brand");
|
2023-01-12 17:41:14 +01:00
|
|
|
}
|
2025-08-22 10:12:06 +02:00
|
|
|
&--neutral {
|
|
|
|
|
@include button-variant("neutral");
|
2023-12-20 11:01:54 +01:00
|
|
|
}
|
2025-08-22 10:12:06 +02:00
|
|
|
&--warning {
|
|
|
|
|
@include button-variant("warning");
|
2023-01-12 17:41:14 +01:00
|
|
|
}
|
2025-08-22 10:12:06 +02:00
|
|
|
&--error {
|
|
|
|
|
@include button-variant("error");
|
2023-12-20 11:01:54 +01:00
|
|
|
}
|
2025-08-22 10:12:06 +02:00
|
|
|
&--success {
|
|
|
|
|
@include button-variant("success");
|
2023-01-12 17:41:14 +01:00
|
|
|
}
|
2025-08-22 10:12:06 +02:00
|
|
|
&--info {
|
|
|
|
|
@include button-variant("info");
|
2023-01-12 17:41:14 +01:00
|
|
|
}
|
2023-03-31 17:25:45 +02:00
|
|
|
}
|