@toantranmei/editor 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +33 -0
  2. package/package.json +9 -10
package/README.md CHANGED
@@ -313,6 +313,39 @@ preflight) don't affect the editor, while your own CSS — unlayered, or in `com
313
313
  `utilities` — overrides it without `!important`. Every part has a stable `me-*` class
314
314
  (`.me-menu-item`, `.me-callout`, `.me-code-block`, …).
315
315
 
316
+ ### Match a shadcn/ui + Tailwind app
317
+
318
+ Point the editor's semantic tokens at shadcn's CSS variables, and it follows the app's theme,
319
+ including dark mode (both use `.dark` on `<html>`). In shadcn, `accent` is the subtle hover
320
+ background and `primary` is the brand color, so map them that way round:
321
+
322
+ ```ts
323
+ import { defineTokens } from '@toantranmei/editor'
324
+
325
+ // Tailwind v4 / shadcn v4 variables are full colors. On Tailwind v3 (HSL triplets) use 'hsl(var(--primary))'.
326
+ export const tokens = defineTokens({
327
+ color: {
328
+ text: 'var(--foreground)',
329
+ textMuted: 'var(--muted-foreground)',
330
+ bg: 'var(--background)',
331
+ elevated: 'var(--popover)',
332
+ surface: 'var(--muted)',
333
+ hover: 'var(--accent)',
334
+ border: 'var(--border)',
335
+ accent: 'var(--primary)',
336
+ onAccent: 'var(--primary-foreground)',
337
+ danger: 'var(--destructive)',
338
+ },
339
+ radius: { sm: 'calc(var(--radius) - 4px)', md: 'calc(var(--radius) - 2px)', lg: 'var(--radius)' },
340
+ font: { sans: 'var(--font-sans)', mono: 'var(--font-mono)' },
341
+ components: { input: { focusRing: 'var(--ring)' } },
342
+ })
343
+ ```
344
+
345
+ Tailwind v4 works out of the box (its preflight lives in the `base` layer). Tailwind v3 emits its
346
+ preflight outside any cascade layer, which beats layered CSS, so it can reset editor buttons,
347
+ lists and headings.
348
+
316
349
  ### Colors in documents
317
350
 
318
351
  Text, highlight and callout colors are stored **by name** (`data-text-color="red"`), not as hex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toantranmei/editor",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Notion-style block editor for Vue 3 and Nuxt, built on Tiptap.",
5
5
  "keywords": [
6
6
  "vue",
@@ -46,14 +46,6 @@
46
46
  "sideEffects": [
47
47
  "**/*.css"
48
48
  ],
49
- "scripts": {
50
- "build": "node scripts/check-styles.mjs && vite build && vue-tsc -p tsconfig.build.json && node scripts/check-deps.mjs",
51
- "dev": "vite build --watch",
52
- "typecheck": "vue-tsc --noEmit -p tsconfig.json",
53
- "check:deps": "node scripts/check-deps.mjs",
54
- "check:styles": "node scripts/check-styles.mjs",
55
- "prepublishOnly": "pnpm run build"
56
- },
57
49
  "peerDependencies": {
58
50
  "@nuxt/kit": "^4.0.0",
59
51
  "katex": "^0.19.1",
@@ -119,5 +111,12 @@
119
111
  },
120
112
  "engines": {
121
113
  "node": ">=20"
114
+ },
115
+ "scripts": {
116
+ "build": "node scripts/check-styles.mjs && vite build && vue-tsc -p tsconfig.build.json && node scripts/check-deps.mjs",
117
+ "dev": "vite build --watch",
118
+ "typecheck": "vue-tsc --noEmit -p tsconfig.json",
119
+ "check:deps": "node scripts/check-deps.mjs",
120
+ "check:styles": "node scripts/check-styles.mjs"
122
121
  }
123
- }
122
+ }