mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-23 02:36:57 -04:00
247 lines
7.8 KiB
CSS
247 lines
7.8 KiB
CSS
[data-component="button"] {
|
|
position: relative;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 6px;
|
|
border-radius: 6px;
|
|
font-style: normal;
|
|
font-weight: 530;
|
|
font-size: 13px;
|
|
line-height: 20px;
|
|
color: var(--oc-text-base);
|
|
text-shadow: none;
|
|
font-variant-numeric: tabular-nums;
|
|
letter-spacing: -0.04px;
|
|
user-select: none;
|
|
cursor: pointer;
|
|
outline: none;
|
|
}
|
|
|
|
[data-component="button"]:focus {
|
|
outline: none;
|
|
}
|
|
|
|
[data-component="button"]:is(:focus-visible, [data-state="focus"]):not(:disabled):not([data-variant="loading"]) {
|
|
outline: 2px solid var(--oc-border-focus);
|
|
outline-offset: 2.5px;
|
|
}
|
|
|
|
[data-component="button"][data-size="normal"] {
|
|
height: 28px;
|
|
padding: 0 11px;
|
|
}
|
|
|
|
[data-component="button"][data-size="small"] {
|
|
height: 24px;
|
|
padding: 0 9px;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
[data-component="button"][data-size="large"] {
|
|
height: 32px;
|
|
padding: 0 15px;
|
|
}
|
|
|
|
[data-component="button"][data-icon][data-size="small"] {
|
|
padding-left: 9px;
|
|
}
|
|
|
|
[data-component="button"][data-icon][data-size="normal"] {
|
|
padding-left: 11px;
|
|
}
|
|
|
|
[data-component="button"][data-icon][data-size="large"] {
|
|
padding-left: 15px;
|
|
}
|
|
|
|
[data-component="button"] [data-slot="icon-svg"] {
|
|
color: currentColor;
|
|
}
|
|
|
|
/* Neutral */
|
|
[data-component="button"][data-variant="neutral"] {
|
|
background-color: var(--oc-bg-button-neutral);
|
|
color: var(--oc-text-base);
|
|
box-shadow: var(--oc-elevation-button-neutral);
|
|
}
|
|
|
|
[data-component="button"][data-variant="neutral"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
background-image:
|
|
linear-gradient(90deg, var(--oc-overlay-hover) 0%, var(--oc-overlay-hover) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-button-neutral) 0%, var(--oc-bg-button-neutral) 100%);
|
|
}
|
|
|
|
[data-component="button"][data-variant="neutral"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
background-image:
|
|
linear-gradient(90deg, var(--oc-overlay-pressed) 0%, var(--oc-overlay-pressed) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-button-neutral) 0%, var(--oc-bg-button-neutral) 100%);
|
|
}
|
|
|
|
[data-component="button"][data-variant="neutral"]:is(:disabled, [data-state="disabled"]) {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Danger */
|
|
[data-component="button"][data-variant="danger"] {
|
|
background-color: var(--oc-bg-button-neutral);
|
|
color: var(--oc-state-fg-danger);
|
|
box-shadow: var(--oc-elevation-button-neutral);
|
|
}
|
|
|
|
[data-component="button"][data-variant="danger"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
background-image:
|
|
linear-gradient(90deg, var(--oc-overlay-hover) 0%, var(--oc-overlay-hover) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-button-neutral) 0%, var(--oc-bg-button-neutral) 100%);
|
|
}
|
|
|
|
[data-component="button"][data-variant="danger"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
background-image:
|
|
linear-gradient(90deg, var(--oc-overlay-pressed) 0%, var(--oc-overlay-pressed) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-button-neutral) 0%, var(--oc-bg-button-neutral) 100%);
|
|
}
|
|
|
|
[data-component="button"][data-variant="danger"]:is(:disabled, [data-state="disabled"]) {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
[data-component="button"][data-variant="warning"] {
|
|
background-color: var(--oc-bg-button-neutral);
|
|
color: var(--oc-state-fg-warning);
|
|
box-shadow: var(--oc-elevation-button-neutral);
|
|
}
|
|
|
|
[data-component="button"][data-variant="warning"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
background-image:
|
|
linear-gradient(90deg, var(--oc-overlay-hover) 0%, var(--oc-overlay-hover) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-button-neutral) 0%, var(--oc-bg-button-neutral) 100%);
|
|
}
|
|
|
|
[data-component="button"][data-variant="warning"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
background-image:
|
|
linear-gradient(90deg, var(--oc-overlay-pressed) 0%, var(--oc-overlay-pressed) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-button-neutral) 0%, var(--oc-bg-button-neutral) 100%);
|
|
}
|
|
|
|
[data-component="button"][data-variant="warning"]:is(:disabled, [data-state="disabled"]) {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Outline */
|
|
[data-component="button"][data-variant="outline"] {
|
|
background-color: transparent;
|
|
color: var(--oc-text-base);
|
|
box-shadow: inset 0 0 0 1px var(--oc-border-muted);
|
|
}
|
|
|
|
[data-component="button"][data-variant="outline"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
background-color: var(--oc-overlay-hover);
|
|
}
|
|
|
|
[data-component="button"][data-variant="outline"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
background-color: var(--oc-overlay-pressed);
|
|
}
|
|
|
|
[data-component="button"][data-variant="outline"]:is(:disabled, [data-state="disabled"]) {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Contrast */
|
|
[data-component="button"][data-variant="contrast"] {
|
|
background-image:
|
|
linear-gradient(180deg, var(--oc-alpha-light-20) 0%, var(--oc-alpha-light-0) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-contrast) 0%, var(--oc-bg-contrast) 100%);
|
|
color: var(--oc-text-contrast);
|
|
text-shadow: 0 0.5px 0.5px rgba(0, 0, 0, 0.3);
|
|
box-shadow: var(--oc-elevation-button-contrast);
|
|
}
|
|
|
|
[data-component="button"][data-variant="contrast"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
background-image:
|
|
linear-gradient(90deg, var(--oc-overlay-contrast-hover) 0%, var(--oc-overlay-contrast-hover) 100%),
|
|
linear-gradient(180deg, var(--oc-alpha-light-20) 0%, var(--oc-alpha-light-0) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-contrast) 0%, var(--oc-bg-contrast) 100%);
|
|
}
|
|
|
|
[data-component="button"][data-variant="contrast"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
background-image:
|
|
linear-gradient(90deg, var(--oc-overlay-contrast-pressed) 0%, var(--oc-overlay-contrast-pressed) 100%),
|
|
linear-gradient(180deg, var(--oc-alpha-light-20) 0%, var(--oc-alpha-light-0) 100%),
|
|
linear-gradient(90deg, var(--oc-bg-contrast) 0%, var(--oc-bg-contrast) 100%);
|
|
}
|
|
|
|
[data-component="button"][data-variant="contrast"]:is(:disabled, [data-state="disabled"]) {
|
|
opacity: 0.4;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Loading */
|
|
[data-component="button"][data-variant="loading"] {
|
|
background: #f2f2f2;
|
|
color: var(--oc-text-base);
|
|
box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.08);
|
|
cursor: default;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* Ghost */
|
|
[data-component="button"][data-variant="ghost"] {
|
|
background-color: transparent;
|
|
color: var(--oc-text-base);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost"]:is(:hover, [data-state="hover"]):not(:disabled):not([data-expanded]) {
|
|
background-color: var(--oc-overlay-hover);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
background-color: var(--oc-overlay-pressed);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost"]:where([data-expanded]):not(:disabled) {
|
|
background-color: var(--oc-overlay-pressed);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost"]:is(:disabled, [data-state="disabled"]) {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Ghost muted */
|
|
[data-component="button"][data-variant="ghost-muted"] {
|
|
background-color: transparent;
|
|
color: var(--oc-text-muted);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost-muted"] [data-slot="icon-svg"] {
|
|
color: var(--oc-icon-muted);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost-muted"]:is(:hover, [data-state="hover"]):not(:disabled):not(
|
|
[data-expanded]
|
|
) {
|
|
background-color: var(--oc-overlay-hover);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost-muted"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
background-color: var(--oc-overlay-pressed);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost-muted"]:where([data-expanded]):not(:disabled) {
|
|
background-color: var(--oc-overlay-pressed);
|
|
color: var(--oc-text-base);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost-muted"]:where([data-expanded]):not(:disabled) [data-slot="icon-svg"] {
|
|
color: var(--oc-icon-base);
|
|
}
|
|
|
|
[data-component="button"][data-variant="ghost-muted"]:is(:disabled, [data-state="disabled"]) {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|