189 lines
4.2 KiB
CSS
189 lines
4.2 KiB
CSS
.ds-button {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: var(--ds-space-2);
|
|
min-height: var(--ds-control-md);
|
|
padding-inline: var(--ds-space-4);
|
|
border: var(--ds-border-thin) solid var(--ds-action-border);
|
|
border-radius: var(--ds-radius-control);
|
|
background: var(--ds-action-bg);
|
|
color: var(--ds-action-text);
|
|
font-size: var(--ds-text-sm);
|
|
font-weight: var(--ds-weight-medium);
|
|
line-height: var(--ds-leading-snug);
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
transition: background-color var(--ds-duration-fast) var(--ds-ease-standard),
|
|
border-color var(--ds-duration-fast) var(--ds-ease-standard),
|
|
color var(--ds-duration-fast) var(--ds-ease-standard);
|
|
}
|
|
|
|
a.ds-button:link,
|
|
a.ds-button:visited {
|
|
color: var(--ds-action-text);
|
|
}
|
|
|
|
a.ds-button--secondary:link,
|
|
a.ds-button--secondary:visited {
|
|
color: var(--ds-action2-text);
|
|
}
|
|
|
|
a.ds-button--ghost:link,
|
|
a.ds-button--ghost:visited {
|
|
color: var(--ds-action3-text);
|
|
}
|
|
|
|
a.ds-button--danger:link,
|
|
a.ds-button--danger:visited {
|
|
color: var(--ds-danger-action-text);
|
|
}
|
|
|
|
.ds-button:hover:not(:disabled, [aria-disabled="true"]) {
|
|
background: var(--ds-action-bg-hover);
|
|
}
|
|
|
|
.ds-button:active:not(:disabled, [aria-disabled="true"]) {
|
|
background: var(--ds-action-bg-active);
|
|
}
|
|
|
|
.ds-button:disabled,
|
|
.ds-button[aria-disabled="true"] {
|
|
background: var(--ds-disabled-bg);
|
|
border-color: var(--ds-disabled-border);
|
|
color: var(--ds-disabled-text);
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.ds-button--secondary {
|
|
background: var(--ds-action2-bg);
|
|
border-color: var(--ds-action2-border);
|
|
color: var(--ds-action2-text);
|
|
}
|
|
|
|
.ds-button--secondary:hover:not(:disabled, [aria-disabled="true"]) {
|
|
background: var(--ds-action2-bg-hover);
|
|
border-color: var(--ds-action2-border-hover);
|
|
}
|
|
|
|
.ds-button--ghost {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: var(--ds-action3-text);
|
|
}
|
|
|
|
.ds-button--ghost:hover:not(:disabled, [aria-disabled="true"]) {
|
|
background: var(--ds-action3-bg-hover);
|
|
color: var(--ds-text);
|
|
}
|
|
|
|
.ds-button--danger {
|
|
background: var(--ds-danger-action-bg);
|
|
border-color: var(--ds-danger-action-border);
|
|
color: var(--ds-danger-action-text);
|
|
}
|
|
|
|
.ds-button--danger:hover:not(:disabled, [aria-disabled="true"]) {
|
|
background: var(--ds-danger-action-bg-hover);
|
|
}
|
|
|
|
.ds-button--danger:active:not(:disabled, [aria-disabled="true"]) {
|
|
background: var(--ds-danger-action-bg-active);
|
|
}
|
|
|
|
.ds-button--sm {
|
|
min-height: var(--ds-control-sm);
|
|
padding-inline: var(--ds-space-3);
|
|
font-size: var(--ds-text-xs);
|
|
}
|
|
|
|
.ds-button--lg {
|
|
min-height: var(--ds-control-lg);
|
|
padding-inline: var(--ds-space-6);
|
|
font-size: var(--ds-text-md);
|
|
}
|
|
|
|
.ds-button--icon {
|
|
width: var(--ds-control-lg);
|
|
min-height: var(--ds-control-lg);
|
|
padding: 0;
|
|
}
|
|
|
|
.ds-button--icon.ds-button--sm {
|
|
width: var(--ds-control-sm);
|
|
min-height: var(--ds-control-sm);
|
|
}
|
|
|
|
.ds-button--icon.ds-button--lg {
|
|
width: var(--ds-control-lg);
|
|
min-height: var(--ds-control-lg);
|
|
}
|
|
|
|
.ds-button .ds-icon {
|
|
width: var(--ds-icon-md);
|
|
height: var(--ds-icon-md);
|
|
}
|
|
|
|
.ds-button--lg .ds-icon {
|
|
width: var(--ds-icon-lg);
|
|
height: var(--ds-icon-lg);
|
|
}
|
|
|
|
.ds-button[data-loading="true"],
|
|
.ds-button[aria-busy="true"] {
|
|
pointer-events: none;
|
|
cursor: progress;
|
|
}
|
|
|
|
.ds-button[data-loading="true"] .ds-button__icon,
|
|
.ds-button[aria-busy="true"] .ds-button__icon {
|
|
display: none;
|
|
}
|
|
|
|
.ds-button:not([data-loading="true"]):not([aria-busy="true"]) .ds-spinner {
|
|
display: none;
|
|
}
|
|
|
|
.ds-spinner {
|
|
width: var(--ds-icon-sm);
|
|
height: var(--ds-icon-sm);
|
|
border: var(--ds-border-strong) solid currentColor;
|
|
border-right-color: transparent;
|
|
border-radius: var(--ds-radius-full);
|
|
animation: ds-spin 0.8s linear infinite;
|
|
}
|
|
|
|
@keyframes ds-spin {
|
|
to {
|
|
transform: rotate(1turn);
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.ds-spinner {
|
|
animation: none;
|
|
border-right-color: currentColor;
|
|
opacity: 0.6;
|
|
}
|
|
}
|
|
|
|
.ds-button-group {
|
|
display: inline-flex;
|
|
gap: var(--ds-space-2);
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
@media (pointer: coarse) {
|
|
.ds-button,
|
|
.ds-button--sm,
|
|
.ds-button--icon.ds-button--sm {
|
|
min-height: var(--ds-target-touch);
|
|
}
|
|
|
|
.ds-button--icon.ds-button--sm {
|
|
width: var(--ds-target-touch);
|
|
}
|
|
}
|