Skip to content

Commit

Permalink
feat(menu): expose max height and min-width custom properties
Browse files Browse the repository at this point in the history
fixes #4291

PiperOrigin-RevId: 546330782
  • Loading branch information
Elliott Marquez authored and copybara-github committed Jul 7, 2023
1 parent 2922914 commit ab85ae1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion menu/lib/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
)
);

min-width: 300px;
min-width: var(--_min-width);
max-height: var(--_max-height);
}

.menu {
Expand Down
15 changes: 14 additions & 1 deletion tokens/_md-comp-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ $supported-tokens: (
'container-elevation',
'container-shadow-color',
'container-shape',
'max-height',
'min-width',
// go/keep-sorted end
);

Expand All @@ -41,8 +43,19 @@ $_default: (
$tokens: values.validate(
md-comp-menu.values($deps),
$supported-tokens: $supported-tokens,
$unsupported-tokens: $unsupported-tokens
$unsupported-tokens: $unsupported-tokens,
$new-tokens: _get-new-tokens($exclude-hardcoded-values)
);

@return $tokens;
}

// add sizing tokens.
@function _get-new-tokens($exclude-hardcoded-values) {
@return (
// go/keep-sorted start
'max-height': if($exclude-hardcoded-values, null, auto),
'min-width': if($exclude-hardcoded-values, null, 300px),
// go/keep-sorted end
);
}

0 comments on commit ab85ae1

Please sign in to comment.