Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(menu): disabled color for value text and add disabled stories #2579

Merged
merged 1 commit into from
Mar 4, 2024
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
6 changes: 4 additions & 2 deletions components/menu/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ governing permissions and limitations under the License.
background-color: transparent;

.spectrum-Menu-itemLabel,
.spectrum-Menu-sectionHeading {
.spectrum-Menu-sectionHeading,
.spectrum-Menu-itemValue {
color: var(--highcontrast-menu-item-color-disabled, var(--mod-menu-item-label-content-color-disabled, var(--spectrum-menu-item-label-content-color-disabled)));
}

Expand All @@ -797,7 +798,8 @@ governing permissions and limitations under the License.
background-color: transparent;

.spectrum-Menu-itemLabel,
.spectrum-Menu-sectionHeading {
.spectrum-Menu-sectionHeading,
.spectrum-Menu-itemValue {
color: var(--highcontrast-menu-item-color-disabled, var(--mod-menu-item-label-content-color-disabled, var(--spectrum-menu-item-label-content-color-disabled)));
}

Expand Down
9 changes: 9 additions & 0 deletions components/menu/stories/menu.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ WithActions.args = {
{
label: "Subtract",
},
{
label: "Example of a disabled menu item",
isDisabled: true,
},
],
};

Expand All @@ -348,6 +352,11 @@ WithValueAndActions.args = {
label: "Subtract",
value: "Value"
},
{
label: "Example of a disabled menu item",
value: "Value",
isDisabled: true,
},
],
};

Expand Down
4 changes: 3 additions & 1 deletion components/menu/stories/template.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { html } from "lit";
import { classMap } from "lit/directives/class-map.js";
import { styleMap } from "lit/directives/style-map.js";
import { ifDefined } from "lit/directives/if-defined.js";
import { styleMap } from "lit/directives/style-map.js";
import { when } from "lit/directives/when.js";

import { Template as Checkbox } from "@spectrum-css/checkbox/stories/template.js";
Expand Down Expand Up @@ -109,6 +109,7 @@ export const MenuItem = ({
size,
isEmphasized: true,
isChecked: isSelected,
isDisabled,
id: `menu-checkbox-${idx}`,
customClasses: [
`${rootClass}Checkbox`,
Expand Down Expand Up @@ -136,6 +137,7 @@ export const MenuItem = ({
...globals,
size,
isChecked: isSelected,
isDisabled,
label: null,
id: `menu-switch-${idx}`,
customClasses: [
Expand Down
Loading