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
The `defaultStyles` property DOES NOT set the actual CSS to the affected blocks. CSS styles have to be applied separately:
76
+
77
+
```html{12-19}
78
+
new richtext.Richtext("#root", {
79
+
defaultStyles: {
80
+
h2: {
81
+
"font-family": "Roboto",
82
+
"font-size": "28px",
83
+
color: "purple",
84
+
background: "#FFC0CB"
85
+
}
86
+
}
87
+
});
88
+
89
+
<style>
90
+
#container h2 {
91
+
font-family: Roboto;
92
+
font-size: 28px;
93
+
color: purple;
94
+
background: #FFC0CB;
95
+
}
96
+
</style>
97
+
```
98
+
99
+
In this example, all `h2` blocks are assigned to the `"Roboto"` font-family with a font-size of 28px with both the foreground and the background colors changed as well. Css styles assigned to `h2` blocks as well.
Copy file name to clipboardExpand all lines: docs/api/config/layout-mode.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,25 +8,33 @@ description: You can learn about the layoutMode config in the documentation of t
8
8
9
9
### Description
10
10
11
-
@short: Optional. ...
11
+
@short: Optional. Specifies the layout mode for the main editor area
12
12
13
13
### Usage
14
14
15
15
~~~jsx {}
16
-
layoutMode?:...;
16
+
layoutMode:"classic"|"document";
17
+
~~~
18
+
19
+
The `"classic"` mode represents the edit area that fits the entire page. The `"document"` mode closely represent the real document sizes (sizes used: A4, A5, A6, A7).
20
+
21
+
### Default config
22
+
23
+
~~~jsx
24
+
layoutMode:"classic"
17
25
~~~
18
26
19
27
### Example
20
28
21
-
~~~jsx {4}
29
+
~~~jsx {2}
22
30
newrichtext.Richtext("#root", {
23
-
layoutMode:...
31
+
layoutMode:"document"// initializes richtext with "document" mode by default
24
32
// other parameters
25
33
});
26
34
~~~
27
35
28
-
**Change log:** The property was added in v2.0
36
+
**Change log:** The property was added in v2.0 instead of the deprecated `mode` property
0 commit comments