fix(css): scope utilities under the view root so tailwind plugins stop outranking each other

This commit is contained in:
hh
2026-08-29 19:39:21 +02:00
parent b46dab194b
commit ab22efff7b
7 changed files with 210 additions and 5 deletions
+3 -1
View File
@@ -38,7 +38,7 @@ Changing settings remounts open panels.
```
bun install
bun run dev # css + esbuild watch
bun run build # svelte-check + css (minified) + bundle
bun run build # svelte-check + css (minified, scoped) + bundle
bun run test # vitest (theme rules) + tests/smoke.mjs (jsdom, fake gateway)
bun run preview # the panel in a browser, no Obsidian: http://localhost:4174/#<scene>
make check # ultracite + svelte-check
@@ -48,6 +48,8 @@ make zip
Preview scenes (`#thread` default, `#switcher`, `#closed`, `#menu`, `#actions`, `#activity`, `#branch`, `#question`, `#deep`, `#empty`, `#offline`, `#stream`; suffix `-light` for the light theme). Width is the window: run headless Chrome with `--window-size=340,720` for the sidedock, `1100,720` for a tab, `390,800` for a phone. Set `VAULT=` or `THEME=` to preview against a community theme; `app.css` is read from the Obsidian install.
`styles.css` is Tailwind output run through `scripts/scope-css.mjs`: every selector gets `:is(.beaver-root, .beaver-root *)` in front. Other Tailwind plugins (beaver-calendar for one) put their utilities into the same `utilities` cascade layer, and without the extra specificity whichever plugin loaded last would win - its `.hidden` over ours and the other way round.
## Install
`make install VAULT=…` copies `manifest.json`, `main.js`, `styles.css`, `versions.json` into `<vault>/.obsidian/plugins/beaver`; then enable **Beaver** in Settings → Community plugins. On a phone, sync the four files with Obsidian Sync ("Installed community plugins") or any file sync, and point the settings at a URL the phone can reach.