Skip to content

Commit

Permalink
fix(menu): update menu item border radius (#3504)
Browse files Browse the repository at this point in the history
* chore(menu): remove mod property and add fallback for spectrum classic
  • Loading branch information
rubencarvalho authored and castastrophe committed Jan 21, 2025
1 parent 7f24248 commit 005b0c7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shiny-files-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/menu": patch
---

Updated the menu item border radius in Spectrum 2.
5 changes: 4 additions & 1 deletion components/menu/dist/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
"--spectrum-menu-item-checkmark-width-medium",
"--spectrum-menu-item-checkmark-width-small",
"--spectrum-menu-item-collapsible-no-icon-submenu-item-padding-x-start",
"--spectrum-menu-item-corner-radius",
"--spectrum-menu-item-description-color-default",
"--spectrum-menu-item-description-color-disabled",
"--spectrum-menu-item-description-color-down",
Expand Down Expand Up @@ -332,6 +333,7 @@
"--spectrum-component-top-to-text-200",
"--spectrum-component-top-to-text-300",
"--spectrum-component-top-to-text-75",
"--spectrum-corner-radius-100",
"--spectrum-disabled-content-color",
"--spectrum-divider-thickness-medium",
"--spectrum-divider-thickness-small",
Expand Down Expand Up @@ -376,7 +378,8 @@
"system-theme": [
"--system-menu-item-background-color-down",
"--system-menu-item-background-color-hover",
"--system-menu-item-background-color-key-focus"
"--system-menu-item-background-color-key-focus",
"--system-menu-item-corner-radius"
],
"passthroughs": [
"--mod-checkbox-text-to-control",
Expand Down
2 changes: 2 additions & 0 deletions components/menu/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@
position: relative;
align-items: center;

border-radius: var(--spectrum-menu-item-corner-radius);

box-sizing: border-box;

background-color: var(--highcontrast-menu-item-background-color-default, var(--mod-menu-item-background-color-default, var(--spectrum-menu-item-background-color-default)));
Expand Down
1 change: 1 addition & 0 deletions components/menu/themes/spectrum-two.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
--spectrum-menu-item-background-color-hover: rgba(var(--spectrum-gray-1000-rgb), var(--spectrum-transparent-black-200-opacity));
--spectrum-menu-item-background-color-down: rgba(var(--spectrum-gray-1000-rgb), var(--spectrum-transparent-black-200-opacity));
--spectrum-menu-item-background-color-key-focus: rgba(var(--spectrum-gray-1000-rgb), var(--spectrum-transparent-black-200-opacity));
--spectrum-menu-item-corner-radius: var(--spectrum-corner-radius-100);
}
}
1 change: 1 addition & 0 deletions components/menu/themes/spectrum.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
--spectrum-menu-item-background-color-hover: rgba(var(--spectrum-gray-900-rgb), var(--spectrum-transparent-black-200-opacity));
--spectrum-menu-item-background-color-down: rgba(var(--spectrum-gray-900-rgb), var(--spectrum-transparent-black-200-opacity));
--spectrum-menu-item-background-color-key-focus: rgba(var(--spectrum-gray-900-rgb), var(--spectrum-transparent-black-200-opacity));
--spectrum-menu-item-corner-radius: 0;
}
}

0 comments on commit 005b0c7

Please sign in to comment.