Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/breezy-crews-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@spectrum-css/combobox": patch
---

Fast follow fixes for combobox

- corrects container query for the `--system` reference to "legacy" in the combobox/themes/spectrum.css file
- corrects the border colors for several combobox states including focus, keyboardFocus, focus+hover, disabled, read-only for all themes
- adds `--spectrum-combobox-readonly-input-border-color: var(--spectrum-gray-400);` to express.css theme so that the default border and read-only border colors are the same
7 changes: 6 additions & 1 deletion components/combobox/dist/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"--mod-combobox-inline-size",
"--mod-combobox-line-height",
"--mod-combobox-min-inline-size",
"--mod-combobox-readonly-border-color-disabled",
"--mod-combobox-readonly-input-border-color",
"--mod-combobox-spacing-block-end-edge-to-text",
"--mod-combobox-spacing-block-start-edge-to-text",
Expand Down Expand Up @@ -171,6 +172,7 @@
"--spectrum-combobox-line-height",
"--spectrum-combobox-min-inline-size",
"--spectrum-combobox-readonly-background-color-disabled",
"--spectrum-combobox-readonly-border-color-disabled",
"--spectrum-combobox-readonly-border-color-invalid-default",
"--spectrum-combobox-readonly-input-background-color",
"--spectrum-combobox-readonly-input-border-color",
Expand Down Expand Up @@ -252,16 +254,19 @@
"system-theme": [
"--system-combobox-background-color-disabled",
"--system-combobox-border-color-default",
"--system-combobox-border-color-disabled",
"--system-combobox-border-color-focus",
"--system-combobox-border-color-focus-hover",
"--system-combobox-border-color-hover",
"--system-combobox-border-color-key-focus"
"--system-combobox-border-color-key-focus",
"--system-combobox-readonly-input-border-color"
],
"passthroughs": [
"--mod-picker-button-background-color",
"--mod-picker-button-background-color-disabled",
"--mod-picker-button-background-color-quiet",
"--mod-picker-button-border-color",
"--mod-picker-button-border-color-disabled",
"--mod-picker-button-border-color-quiet",
"--mod-picker-button-border-width",
"--mod-picker-button-font-color-disabled",
Expand Down
10 changes: 5 additions & 5 deletions components/combobox/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

--mod-textfield-border-width: var(--mod-combobox-border-width, var(--spectrum-combobox-border-width));
--mod-textfield-border-color: var(--mod-combobox-border-color-default, var(--spectrum-combobox-border-color-default));
--mod-textfield-border-color-disabled: var(--mod-combobox-border-color-disabled, transparent);
--mod-textfield-border-color-disabled: var(--mod-combobox-border-color-disabled, var(--spectrum-combobox-border-color-disabled));
--mod-textfield-border-color-focus: var(--mod-combobox-border-color-focus, var(--spectrum-combobox-border-color-focus));
--mod-textfield-border-color-focus-hover: var(--mod-combobox-border-color-focus-hover, var(--spectrum-combobox-border-color-focus-hover));
--mod-textfield-border-color-hover: var(--mod-combobox-border-color-hover, var(--spectrum-combobox-border-color-hover));
Expand All @@ -89,15 +89,15 @@
--mod-picker-button-background-color: var(--mod-combobox-background-color-default);
--mod-picker-button-background-color-disabled: var(--mod-combobox-background-color-disabled);
--mod-picker-button-font-color-disabled: var(--mod-combobox-font-color-disabled);
--mod-picker-button-border-color-disabled: var(--mod-combobox-border-color-disabled, var(--spectrum-combobox-border-color-disabled));
/* @passthroughs end -- settings for nested Picker Button component */

/*** Read-only Colors ***/
--spectrum-combobox-readonly-input-background-color: var(--spectrum-gray-50);
--spectrum-combobox-readonly-input-border-color: var(--spectrum-gray-500);
--spectrum-combobox-readonly-border-color-invalid-default: var(--spectrum-negative-border-color-default);
--spectrum-combobox-readonly-background-color-disabled: var(--spectrum-disabled-background-color);
--spectrum-combobox-readonly-text-color-disabled: var(--spectrum-disabled-content-color);
--spectrum-combobox-border-color-disabled: var(--spectrum-disabled-border-color);
--spectrum-combobox-readonly-border-color-disabled: var(--spectrum-disabled-border-color);
}

.spectrum-Combobox,
Expand Down Expand Up @@ -248,7 +248,7 @@

&.is-disabled .spectrum-Combobox-input:read-only {
background-color: var(--mod-textfield-background-color-disabled, var(--spectrum-combobox-readonly-background-color-disabled));
border-color: transparent;
border-color: var(--mod-combobox-readonly-border-color-disabled, var(--spectrum-combobox-readonly-border-color-disabled, transparent));
color: var(--highcontrast-textfield-text-color-disabled, var(--mod-textfield-text-color-disabled, var(--spectrum-combobox-readonly-text-color-disabled)));

&:hover {
Expand Down Expand Up @@ -435,7 +435,7 @@

&.is-disabled .spectrum-Combobox-input:read-only {
color: var(--highcontrast-textfield-text-color-disabled, var(--mod-textfield-text-color-disabled, var(--spectrum-combobox-readonly-text-color-disabled)));
border-color: var(--mod-textfield-border-color-disabled, var(--spectrum-combobox-border-color-disabled));
border-color: var(--mod-textfield-border-color-disabled, var(--spectrum-combobox-readonly-border-color-disabled));
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions components/combobox/themes/express.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
--spectrum-combobox-border-color-focus: var(--spectrum-gray-900);
--spectrum-combobox-border-color-focus-hover: var(--spectrum-gray-800);
--spectrum-combobox-border-color-key-focus: var(--spectrum-gray-900);

--spectrum-combobox-readonly-input-border-color: var(--spectrum-gray-400);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see one Express difference in the VRT for this change in the read-only border color. I don't see this one mentioned in the Jira or PR/validation; was this change intended/discussed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh shoot, I forgot to add that to the validation! Great catch. I did mean to make this change, but it was not discussed.

I stumbled on this by chance. As I was going through a bunch of border colors, I saw the default border color was gray-500, and the read-only border color was gray-500 in both S1 and S2 contexts. The default express.css border color was gray-400, but because the read-only input variable wasn't defined, I noticed it was still rendering at gray-500. It seemed like the intention was the keep the same border color for read-only.

I can add the read-only validation to the PR description if you're good with that logic!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what is on production currently:
Screenshot 2025-03-13 at 5 19 57 PM
Screenshot 2025-03-13 at 5 20 03 PM

That just didn't seem right, compared to S1 & S2.

Copy link
Copy Markdown
Collaborator

@jawinn jawinn Mar 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense that it should match the default like the other themes (and not be darker than default). I'd add to the changeset to document that bug fix for Express, including the border color that is changing.

}
}
3 changes: 3 additions & 0 deletions components/combobox/themes/spectrum-two.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
--spectrum-combobox-border-color-focus-hover: var(--spectrum-gray-900);
--spectrum-combobox-border-color-key-focus: var(--spectrum-gray-800);

--spectrum-combobox-readonly-input-border-color: var(--spectrum-gray-500);

--spectrum-combobox-background-color-disabled: var(--spectrum-gray-25);
--spectrum-combobox-border-color-disabled: var(--spectrum-disabled-border-color);
}
}
5 changes: 4 additions & 1 deletion components/combobox/themes/spectrum.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@

@import "./spectrum-two.css";

@container style(--system: spectrum) {
@container style(--system: legacy) {
.spectrum-Combobox {
--spectrum-combobox-border-color-focus: var(--spectrum-gray-500);
--spectrum-combobox-border-color-focus-hover: var(--spectrum-gray-600);
--spectrum-combobox-border-color-key-focus: var(--spectrum-gray-600);

--spectrum-combobox-readonly-input-border-color: var(--spectrum-gray-500);

--spectrum-combobox-background-color-disabled: var(--spectrum-disabled-background-color);
--spectrum-combobox-border-color-disabled: transparent;
}
}