Lucas Ostmann155 downloadsControl image positioning in Bases Card Views via frontmatter properties.
Control image positioning in Obsidian Bases Card Views via frontmatter properties.
By default, cover images in Bases card views are centered. This plugin lets you adjust the position per note — useful when the subject of an image is off-center and gets cropped out.
Quickly set the focal point of cover images using simple preset values — no calculations required.
| Preset | Description |
|---|---|
center |
Center (default) |
top |
Top center |
bottom |
Bottom center |
left |
Left center |
right |
Right center |
top left |
Top left corner |
top right |
Top right corner |
bottom left |
Bottom left corner |
bottom right |
Bottom right corner |
For fine-grained control, position images using exact offset values:
---
image-offset-x: 30%
image-offset-y: 70%
---
Supported units: %, px, em, rem, vh, vw. Plain numbers are treated as pixels (30 → 30px).
Note: Offset properties take priority over
image-positionpresets. If both are set, offsets win.
Rename the frontmatter properties to fit your workflow — fully adjustable in plugin settings without touching your notes.
The plugin uses a MutationObserver to watch for Bases card elements in the DOM. When a card appears:
background-position style is set on the card's cover elementCards are resolved to vault files using these fallbacks in order:
1. data-path attribute → Direct attribute on card element
2. file.path property → Displayed property within the card
3. Internal link href → a.internal-link element
4. data-href attribute → Fallback link attribute
5. Title matching → Match against filenames or frontmatter titles
---
image-position: top
---
---
image-offset-x: 30%
image-offset-y: 70%
---
Both properties can be used independently or combined.
Open Settings → Community Plugins → Bases Image Position:
| Setting | Description | Default |
|---|---|---|
| Image position property | Frontmatter key for preset positions | image-position |
| Image offset X property | Frontmatter key for horizontal offset | image-offset-x |
| Image offset Y property | Frontmatter key for vertical offset | image-offset-y |
| Debug mode | Enable console logging for troubleshooting | false |
<vault>/.obsidian/plugins/bases-image-position/manifest.json and main.js into this foldergit clone https://github.com/LucEast/obsidian-bases-image-position.git
cd obsidian-bases-image-position
npm install
npm run dev # Watch mode – auto-rebuild on changes
npm run build # Production build with type checking
See CLAUDE.md for development guidelines and architecture overview.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'feat: add amazing feature')git push origin feature/amazing-feature)MIT – Free to use and modify.