summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/icon-button.css
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-11-06 09:48:46 -0600
committerAdam <[email protected]>2025-11-06 09:48:51 -0600
commit6ba7c54baba355e3788e371374d26e58b60feb0d (patch)
treea69448dcdcd8e1935b2bc3c7d2344ad78f8ced75 /packages/ui/src/components/icon-button.css
parent146bae82cb584c253a42ed4565d423d9cded93a6 (diff)
downloadopencode-6ba7c54baba355e3788e371374d26e58b60feb0d.tar.gz
opencode-6ba7c54baba355e3788e371374d26e58b60feb0d.zip
feat(desktop): collapsible sidebar
Diffstat (limited to 'packages/ui/src/components/icon-button.css')
-rw-r--r--packages/ui/src/components/icon-button.css87
1 files changed, 55 insertions, 32 deletions
diff --git a/packages/ui/src/components/icon-button.css b/packages/ui/src/components/icon-button.css
index 6fe95fccf..a491074fe 100644
--- a/packages/ui/src/components/icon-button.css
+++ b/packages/ui/src/components/icon-button.css
@@ -2,20 +2,11 @@
display: inline-flex;
align-items: center;
justify-content: center;
- border-radius: 100%;
+ border-radius: 6px;
text-decoration: none;
user-select: none;
aspect-ratio: 1;
-
- &:disabled {
- background-color: var(--icon-strong-disabled);
- color: var(--icon-invert-base);
- cursor: not-allowed;
- }
-
- &:focus {
- outline: none;
- }
+ flex-shrink: 0;
&[data-variant="primary"] {
background-color: var(--icon-strong-base);
@@ -51,45 +42,62 @@
}
&[data-variant="secondary"] {
+ border: transparent;
background-color: var(--button-secondary-base);
color: var(--text-strong);
+ box-shadow: var(--shadow-xs-border);
&:hover:not(:disabled) {
- background-color: var(--surface-hover);
+ background-color: var(--button-secondary-hover);
}
&:active:not(:disabled) {
- background-color: var(--surface-active);
+ background-color: var(--button-secondary-base);
}
&:focus:not(:disabled) {
- background-color: var(--surface-focus);
+ 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;
+ }
+
+ [data-slot="icon"] {
+ color: var(--icon-strong-base);
}
}
&[data-variant="ghost"] {
background-color: transparent;
+ /* color: var(--icon-base); */
[data-slot="icon"] {
- color: var(--icon-weak-base);
+ color: var(--icon-base);
+ }
- &:hover:not(:disabled) {
- color: var(--icon-weak-hover);
+ &:hover:not(:disabled) {
+ background-color: var(--surface-base-hover);
+
+ [data-slot="icon"] {
+ color: var(--icon-hover);
}
- &:active:not(:disabled) {
- color: var(--icon-string-active);
+ }
+ &:active:not(:disabled) {
+ [data-slot="icon"] {
+ color: var(--icon-active);
}
}
-
- /* color: var(--text-strong); */
- /**/
- /* &:hover:not(:disabled) { */
- /* background-color: var(--surface-hover); */
- /* } */
- /* &:active:not(:disabled) { */
- /* background-color: var(--surface-active); */
- /* } */
- /* &:focus:not(:disabled) { */
- /* background-color: var(--surface-focus); */
- /* } */
+ &:selected:not(:disabled) {
+ background-color: var(--surface-base-active);
+ [data-slot="icon"] {
+ color: var(--icon-selected);
+ }
+ }
+ &:focus:not(:disabled) {
+ background-color: var(--surface-focus);
+ }
}
&[data-size="normal"] {
@@ -103,9 +111,14 @@
&[data-size="large"] {
height: 32px;
- padding: 0 8px 0 6px;
+ /* padding: 0 8px 0 6px; */
gap: 8px;
+ [data-slot="icon"] {
+ height: 16px;
+ width: 16px;
+ }
+
/* text-12-medium */
font-family: var(--font-family-sans);
font-size: var(--font-size-small);
@@ -114,4 +127,14 @@
line-height: var(--line-height-large); /* 166.667% */
letter-spacing: var(--letter-spacing-normal);
}
+
+ &:disabled {
+ background-color: var(--icon-strong-disabled);
+ color: var(--icon-invert-base);
+ cursor: not-allowed;
+ }
+
+ &:focus {
+ outline: none;
+ }
}