Constrain context menu to the width of the widest item
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
f403d87eff
commit
3b2f1644fb
8 changed files with 200 additions and 93 deletions
23
styles/src/styleTree/contextMenu.ts
Normal file
23
styles/src/styleTree/contextMenu.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import Theme from "../themes/common/theme";
|
||||
import { shadow, text } from "./components";
|
||||
|
||||
export default function contextMenu(theme: Theme) {
|
||||
return {
|
||||
background: "#ff0000",
|
||||
// background: backgroundColor(theme, 300, "base"),
|
||||
cornerRadius: 6,
|
||||
padding: {
|
||||
bottom: 2,
|
||||
left: 6,
|
||||
right: 6,
|
||||
top: 2,
|
||||
},
|
||||
shadow: shadow(theme),
|
||||
item: {
|
||||
label: text(theme, "sans", "secondary", { size: "sm" }),
|
||||
},
|
||||
separator: {
|
||||
background: "#00ff00"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue