You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-66Lines changed: 60 additions & 66 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
Rich text editor (WYSIWYG) written in Svelte, using [MeltUI](https://melt-ui.com/) headless UI and [tailwindcss](https://tailwindcss.com/) CSS framework.
4
4
5
-
Built on top of [tiptap](https://tiptap.dev/) editor(headless editor) and [prosemirror](https://prosemirror.net/). Easy to use, develop and maintain. A prompt engine that helps to integrate with any AI API, and enhance the writing experience.
5
+
Built on top of [tiptap](https://tiptap.dev/) editor(headless editor) and [prosemirror](https://prosemirror.net/). Easy to use, develop and maintain. A prompt engine that helps to integrate with any AI API, and enhance the writing experience.
6
6
7
-
Dark/Light theme is supported and customizable.
7
+
Dark/Light theme is supported and customizable.
8
8
9
9
## Getting started
10
10
@@ -22,110 +22,110 @@ npm add @nextlint/svelte
22
22
```
23
23
24
24
### Setup
25
+
25
26
Nexltint editor uses headless svelte components from MeltUI and styles it with tailwindcss. The theme tokens are inherited from [Svelte Shadcn](https://www.shadcn-svelte.com/docs/theming).
26
27
27
28
If you already have shadcn setup in your project then you can skip this part.
28
29
29
-
30
30
#### 1. Install tailwindcss and postcss:
31
31
32
32
```sh
33
33
pnpm add -D tailwindcss postcss autoprefixer sass
34
34
npx tailwindcss init -p
35
35
```
36
+
36
37
Now `tailwind.config.js` and `postcss.config.js` are created
37
38
38
39
#### 2. Configure tailwind.config.js:
39
40
40
41
```js
41
-
42
42
// more detail at https://www.shadcn-svelte.com/docs/installation/manual
Theme can customize via css tokens. The default token is located at [EditorTheme.scss](https://github.com/sveltor/nextlint/blob/main/packages/svelte/src/lib/EditorTheme.scss).
101
102
102
103
### Usage:
104
+
103
105
To use the default theme, you need to wrap your `SvelteEditor` component with `ThemeTheme`:
106
+
104
107
```svelte
105
108
<script lang="ts">
106
-
import { SvelteEditor, EditorTheme } from "@nextlint/svelte"
109
+
import {SvelteEditor} from '@nextlint/svelte/EditorTheme';
110
+
import EditorTheme from '@nextlint/svelte/EditorTheme';
0 commit comments