Skip to content

Commit 1589ff9

Browse files
committed
fix styling for ComboBox, DatePicker, Menu, Select for isExpanded
1 parent 0f881cd commit 1589ff9

7 files changed

Lines changed: 13 additions & 12 deletions

File tree

starters/docs/src/Form.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
height: var(--spacing-4);
8282
}
8383

84-
&:where([data-hovered], [data-pressed]) {
84+
&:where([data-hovered], [data-pressed], [data-expanded]) {
8585
background: var(--tint-300);
8686
color: var(--tint-1200);
8787
}
@@ -91,7 +91,8 @@
9191
color: HighlightText;
9292
}
9393

94-
&[data-pressed] {
94+
&[data-pressed],
95+
&[data-expanded] {
9596
scale: 0.9;
9697
}
9798

@@ -104,4 +105,4 @@
104105
background: none;
105106
color: var(--text-color-disabled);
106107
}
107-
}
108+
}

starters/docs/src/Menu.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
}
6464

6565
&[data-open],
66-
&[data-expanded] {
66+
&[data-pressed] {
6767
background: var(--highlight-hover);
6868
}
6969

starters/docs/src/Select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
width: 100%;
1212
min-width: 0;
1313

14-
&[data-expanded] {
14+
&[data-pressed] {
1515
scale: 1;
1616
}
1717
}

starters/docs/src/utilities.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
inset 0 var(--button-gradient-size) var(--button-gradient-size) -2px var(--button-gradient); /* inner gradient */
3636
}
3737

38-
&:where([data-pressed]) {
38+
&:where([data-pressed], [data-expanded]) {
3939
--button-background: oklch(from var(--button-color) var(--lightness-200) var(--chroma-200) h);
4040
}
4141

starters/tailwind/src/Button.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ let button = tv({
1414
base: 'relative inline-flex items-center justify-center gap-2 border border-transparent dark:border-white/10 h-9 box-border px-3.5 py-0 [&:has(>svg:only-child)]:px-0 [&:has(>svg:only-child)]:h-8 [&:has(>svg:only-child)]:w-8 font-sans text-sm text-center transition rounded-lg cursor-default [-webkit-tap-highlight-color:transparent]',
1515
variants: {
1616
variant: {
17-
primary: 'bg-blue-600 hover:bg-blue-700 pressed:bg-blue-800 text-white',
18-
secondary: 'border-black/10 bg-neutral-50 hover:bg-neutral-100 pressed:bg-neutral-200 text-neutral-800 dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:pressed:bg-neutral-500 dark:text-neutral-100',
19-
destructive: 'bg-red-700 hover:bg-red-800 pressed:bg-red-900 text-white',
20-
quiet: 'border-0 bg-transparent hover:bg-neutral-200 pressed:bg-neutral-300 text-neutral-800 dark:hover:bg-neutral-700 dark:pressed:bg-neutral-600 dark:text-neutral-100'
17+
primary: 'bg-blue-600 hover:bg-blue-700 pressed:bg-blue-800 text-white expanded:bg-blue-800',
18+
secondary: 'border-black/10 bg-neutral-50 hover:bg-neutral-100 pressed:bg-neutral-200 text-neutral-800 dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:pressed:bg-neutral-500 dark:text-neutral-100 expanded:bg-neutral-200 dark:expanded:bg-neutral-500',
19+
destructive: 'bg-red-700 hover:bg-red-800 pressed:bg-red-900 text-white expanded:bg-red-900',
20+
quiet: 'border-0 bg-transparent hover:bg-neutral-200 pressed:bg-neutral-300 text-neutral-800 dark:hover:bg-neutral-700 dark:pressed:bg-neutral-600 dark:text-neutral-100 expanded:bg-neutral-300 dark:expanded:bg-neutral-600'
2121
},
2222
isDisabled: {
2323
true: 'border-transparent dark:border-transparent bg-neutral-100 dark:bg-neutral-800 text-neutral-300 dark:text-neutral-600 forced-colors:text-[GrayText]'

starters/tailwind/src/FieldButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface ButtonProps extends RACButtonProps {
1111

1212
let button = tv({
1313
extend: focusRing,
14-
base: 'relative inline-flex items-center border-0 font-sans text-sm text-center transition rounded-md cursor-default p-1 flex items-center justify-center text-neutral-600 bg-transparent hover:bg-black/[5%] pressed:bg-black/10 dark:text-neutral-400 dark:hover:bg-white/10 dark:pressed:bg-white/20 disabled:bg-transparent [-webkit-tap-highlight-color:transparent]',
14+
base: 'relative inline-flex items-center border-0 font-sans text-sm text-center transition rounded-md cursor-default p-1 flex items-center justify-center text-neutral-600 bg-transparent hover:bg-black/[5%] pressed:bg-black/10 dark:text-neutral-400 dark:hover:bg-white/10 dark:pressed:bg-white/20 disabled:bg-transparent [-webkit-tap-highlight-color:transparent] expanded:bg-black/10 dark:expanded:bg-white/20',
1515
variants: {
1616
isDisabled: {
1717
true: 'bg-neutral-100 dark:bg-neutral-800 text-neutral-300 dark:text-neutral-600 forced-colors:text-[GrayText] border-black/5 dark:border-white/5'

starters/tailwind/src/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const styles = tv({
2121
base: 'flex items-center text-start gap-4 w-full font-sans border border-black/10 dark:border-white/10 cursor-default rounded-lg pl-3 pr-2 h-9 min-w-[180px] transition bg-neutral-50 dark:bg-neutral-700 [-webkit-tap-highlight-color:transparent]',
2222
variants: {
2323
isDisabled: {
24-
false: 'text-neutral-800 dark:text-neutral-300 hover:bg-neutral-100 pressed:bg-neutral-200 dark:hover:bg-neutral-600 dark:pressed:bg-neutral-500 group-invalid:outline group-invalid:outline-red-600 forced-colors:group-invalid:outline-[Mark]',
24+
false: 'text-neutral-800 dark:text-neutral-300 hover:bg-neutral-100 pressed:bg-neutral-200 dark:hover:bg-neutral-600 dark:pressed:bg-neutral-500 group-invalid:outline group-invalid:outline-red-600 forced-colors:group-invalid:outline-[Mark] expanded:bg-neutral-200 dark:expanded:bg-neutral-500',
2525
true: 'border-transparent dark:border-transparent text-neutral-200 dark:text-neutral-600 forced-colors:text-[GrayText] bg-neutral-100 dark:bg-neutral-800'
2626
}
2727
}

0 commit comments

Comments
 (0)