Files
monster-menus/README.md
T
olivier 0f257cbace feat!: simplify menu layouts and options
- Three theme-aware layouts (default, minimal, slate) plus small/grid modifiers
- New options: size, gap, radius, padding; per-link-type colors resolve via --mm-* variables
- Remove horizon and aether layouts, wide modifier and hover-font
- Fix class: menus ignoring hover colors (inline styles removed)
- Fix Dataview links not joining the menu row
- Wire up default layout setting
- Parse <angle-bracketed> file link destinations
- Internal links: Ctrl/middle-click new tab, hover preview, keyboard focus
- Keep 0.5rem edit strip working with Obsidian's .embed-actions wrapper, no icon flicker
2026-10-12 21:58:39 -04:00

144 lines
3.6 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Obsidian Menus
Create simple, stylable menus from code blocks. Write links inside a menu code block, and the plugin renders a clean set of clickable items.
## Quick Start
Create a menu using the menu code block:
```markdown
​```menu
layout: default
[[Home]]
[[Projects|My Projects]]
[Google](https://google.com)
[Documents](file:///C:/Users/YourName/Documents)
``​`
```
The plugin supports three link types:
- Internal: `[[Note]]` or `[[Note|Alias]]` opens notes in Obsidian. Ctrl-click or middle-click opens a new tab; Ctrl-hover shows the page preview.
- Web: `[Text](https://example.com)` opens in your browser
- File: `[Text](file:///C:/path/to/file)` opens local files or folders (desktop only). Use `[Text](<file:///C:/path with spaces>)` for paths with spaces.
## Layouts
Three built-in layouts, all following your theme's colors:
- `default` — outlined buttons
- `minimal` — plain text links
- `slate` — filled chips
Add modifiers after the layout name:
- `small` — smaller text and padding
- `grid` — equal-width tiles that fill the row
```code
layout: slate small
[[Dashboard]]
[Resources](https://example.com)
```
Without a `layout:` line, the menu uses the default layout chosen in the plugin settings.
## Options
Customize any menu with `key: value` lines before the links:
| Option | Effect |
|---|---|
| `text`, `bg`, `border` | Link colors |
| `hover-text`, `hover-bg`, `hover-border` | Hover colors |
| `font` | Font family (quote names with spaces: `"Work Sans"`) |
| `size` | Font size (`0.8em`, `14px`) |
| `gap` | Space between links |
| `radius` | Corner rounding (`99px` for pills) |
| `padding` | Space inside each link (`0.3em 1em`) |
Prefix a color or font option with `internal-`, `external-`, or `file-` to target one link type:
```code
layout: minimal
internal-text: var(--text-accent)
external-text: #ff6600
file-text: #0066ff
[[Internal Link]]
[External Link](https://example.com)
[File Link](file:///C:/Documents)
```
Values are plain CSS: hex, rgb, hsl, gradients, or theme variables like `var(--text-accent)`.
Aliases: `background` = `bg`, `accent` = `hover-text`, `text-hover` = `hover-text`, `bg-hover` = `hover-bg`, `border-hover` = `hover-border`.
## Custom Styling
Use `class:` with your own class name instead of a layout. The plugin then applies no built-in styles; it renders the links and sets the options as CSS variables on the container.
Each link also exposes resolved variables (`--mm-text`, `--mm-bg`, `--mm-border`, `--mm-font`, `--mm-hover-text`, `--mm-hover-bg`, `--mm-hover-border`) that already apply the per-link-type options.
```code
class: my-menu
text: #eee
hover-text: #0af
[[Home]]
[Web](https://example.com)
```
```css
.menu-container.my-menu {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.menu-container.my-menu a {
padding: 0.5rem 0.8rem;
border-radius: 6px;
text-decoration: none;
color: var(--mm-text, var(--text-normal));
background: var(--mm-bg, transparent);
}
.menu-container.my-menu a:hover {
color: var(--mm-hover-text, var(--text-accent));
}
```
## Dataview Integration
Generate links dynamically from Dataview queries. Prefix your query with `dataview:` or `dv:`:
```code
layout: default
[[Home]]
dataview: LIST FROM "Projects"
```
The plugin unwraps Dataview results so links blend seamlessly into your menu layout.
## Examples
Pill buttons with a gradient:
```code
layout: default
radius: 99px
bg: linear-gradient(45deg, #667eea, #764ba2)
text: white
hover-text: #ffd700
[[Dashboard]]
[Projects](https://github.com)
```
Compact tile grid:
```code
layout: slate small grid
[[Inbox]]
[[Projects]]
[[Areas]]
[[Resources]]
```