Added CSS Required for Setup (#3711)

* Added CSS Setup Context

It was previously not clear that additional CSS was required to display placeholders.

* Fixed Typo.
This commit is contained in:
James 2023-02-07 09:07:50 +00:00 committed by GitHub
parent 970727fbbf
commit 523aa5ce44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,31 @@ This extension provides placeholder support. Give your users an idea what they s
npm install @tiptap/extension-placeholder
```
### Additional Setup
Placeholders are displayed with the help of CSS.
**Display a Placeholder only for the first line in an empty editor.**
```
.ProseMirror p.is-editor-empty:first-child::before {
color: #adb5bd;
content: attr(data-placeholder);
float: left;
height: 0;
pointer-events: none;
}
```
**Display Placeholders on every new line.**
```
.ProseMirror p.is-empty::before {
color: #adb5bd;
content: attr(data-placeholder);
float: left;
height: 0;
pointer-events: none;
}
```
## Settings
### emptyEditorClass