cloudaxe-opencode/packages/ui/src/components/button.css

167 lines
4 KiB
CSS
Raw Normal View History

2025-10-14 12:14:26 +00:00
[data-component="button"] {
display: inline-flex;
align-items: center;
justify-content: center;
border-style: solid;
border-width: 1px;
2025-12-09 21:32:33 +00:00
border-radius: var(--radius-md);
2025-10-14 12:14:26 +00:00
text-decoration: none;
user-select: none;
2025-11-06 15:48:46 +00:00
cursor: default;
2025-10-31 17:02:12 +00:00
outline: none;
2025-12-14 09:46:40 +00:00
white-space: nowrap;
2025-10-14 12:14:26 +00:00
&[data-variant="primary"] {
2025-12-11 03:16:50 +00:00
background-color: var(--icon-strong-base);
border-color: var(--border-weak-base);
color: var(--icon-invert-base);
[data-slot="icon-svg"] {
color: var(--icon-invert-base);
}
2025-10-14 12:14:26 +00:00
&:hover:not(:disabled) {
2025-12-11 03:16:50 +00:00
background-color: var(--icon-strong-hover);
2025-10-14 12:14:26 +00:00
}
2025-11-14 18:38:52 +00:00
&:focus:not(:disabled) {
2025-12-11 03:16:50 +00:00
background-color: var(--icon-strong-focus);
2025-11-14 18:38:52 +00:00
}
2025-10-14 12:14:26 +00:00
&:active:not(:disabled) {
2025-12-11 03:16:50 +00:00
background-color: var(--icon-strong-active);
2025-10-14 12:14:26 +00:00
}
2025-11-18 17:00:27 +00:00
&:disabled {
2025-12-11 03:16:50 +00:00
background-color: var(--icon-strong-disabled);
[data-slot="icon-svg"] {
color: var(--icon-invert-base);
}
2025-11-18 17:00:27 +00:00
}
2025-11-14 18:38:52 +00:00
}
&[data-variant="ghost"] {
border-color: transparent;
background-color: transparent;
color: var(--text-strong);
&:hover:not(:disabled) {
background-color: var(--surface-raised-base-hover);
}
2025-10-14 12:14:26 +00:00
&:focus:not(:disabled) {
2025-11-14 18:38:52 +00:00
background-color: var(--surface-raised-base-hover);
}
&:active:not(:disabled) {
background-color: var(--surface-raised-base-active);
2025-10-14 12:14:26 +00:00
}
2025-11-18 17:00:27 +00:00
&:disabled {
color: var(--text-weak);
opacity: 0.7;
cursor: not-allowed;
}
2025-12-09 17:08:55 +00:00
&[data-selected="true"]:not(:disabled) {
background-color: var(--surface-raised-base-hover);
}
2025-12-09 18:36:03 +00:00
&[data-active="true"] {
background-color: var(--surface-raised-base-active);
}
2025-10-14 12:14:26 +00:00
}
&[data-variant="secondary"] {
2025-10-31 17:02:12 +00:00
border: transparent;
2025-10-17 17:05:52 +00:00
background-color: var(--button-secondary-base);
2025-10-16 19:53:44 +00:00
color: var(--text-strong);
box-shadow: var(--shadow-xs-border);
2025-10-17 17:05:52 +00:00
2025-10-14 12:14:26 +00:00
&:hover:not(:disabled) {
2025-10-31 17:02:12 +00:00
background-color: var(--button-secondary-hover);
2025-10-14 12:14:26 +00:00
}
&:focus:not(:disabled) {
2025-10-31 17:02:12 +00:00
background-color: var(--button-secondary-base);
}
&:focus-visible:not(:active) {
background-color: var(--button-secondary-base);
box-shadow: var(--shadow-xs-border-focus);
}
&:focus-visible:active {
box-shadow: none;
2025-10-14 12:14:26 +00:00
}
2025-11-14 18:38:52 +00:00
&:active:not(:disabled) {
background-color: var(--button-secondary-base);
2025-11-04 17:31:56 +00:00
scale: 0.99;
transition: all 150ms ease-out;
}
2025-11-18 17:00:27 +00:00
&:disabled {
border-color: var(--border-disabled);
background-color: var(--surface-disabled);
color: var(--text-weak);
cursor: not-allowed;
}
2025-10-23 11:33:52 +00:00
2025-12-01 22:26:06 +00:00
[data-slot="icon-svg"] {
2025-10-23 11:33:52 +00:00
color: var(--icon-strong-base);
}
2025-10-14 12:14:26 +00:00
}
2025-12-12 19:24:11 +00:00
&[data-size="small"] {
height: 22px;
padding: 0 8px;
&[data-icon] {
padding: 0 12px 0 4px;
}
font-size: var(--font-size-small);
line-height: var(--line-height-large);
gap: 4px;
/* text-12-medium */
font-family: var(--font-family-sans);
font-size: var(--font-size-small);
font-style: normal;
font-weight: var(--font-weight-medium);
line-height: var(--line-height-large); /* 166.667% */
letter-spacing: var(--letter-spacing-normal);
}
2025-10-14 12:14:26 +00:00
&[data-size="normal"] {
2025-11-06 21:13:02 +00:00
height: 24px;
2025-10-23 11:33:52 +00:00
padding: 0 6px;
&[data-icon] {
2025-12-10 18:48:08 +00:00
padding: 0 12px 0 4px;
2025-10-23 11:33:52 +00:00
}
2025-10-17 17:05:52 +00:00
font-size: var(--font-size-small);
line-height: var(--line-height-large);
2025-11-06 21:13:02 +00:00
gap: 6px;
2025-12-10 18:48:08 +00:00
/* text-12-medium */
font-family: var(--font-family-sans);
font-size: var(--font-size-small);
font-style: normal;
font-weight: var(--font-weight-medium);
line-height: var(--line-height-large); /* 166.667% */
letter-spacing: var(--letter-spacing-normal);
2025-10-14 12:14:26 +00:00
}
&[data-size="large"] {
2025-10-17 17:05:52 +00:00
height: 32px;
2025-12-11 03:16:50 +00:00
padding: 6px 12px;
2025-10-23 11:33:52 +00:00
&[data-icon] {
2025-12-10 18:48:08 +00:00
padding: 0 12px 0 8px;
2025-10-23 11:33:52 +00:00
}
2025-12-13 12:51:24 +00:00
gap: 8px;
2025-10-17 17:05:52 +00:00
2025-12-10 18:48:08 +00:00
/* text-14-medium */
2025-10-17 17:05:52 +00:00
font-family: var(--font-family-sans);
2025-12-10 18:48:08 +00:00
font-size: 14px;
2025-10-17 17:05:52 +00:00
font-style: normal;
font-weight: var(--font-weight-medium);
2025-12-10 18:48:08 +00:00
line-height: var(--line-height-large); /* 142.857% */
2025-10-17 17:05:52 +00:00
letter-spacing: var(--letter-spacing-normal);
2025-10-14 12:14:26 +00:00
}
2025-10-16 19:53:44 +00:00
&:focus {
outline: none;
}
2025-10-14 12:14:26 +00:00
}