How to link stylesheet to TinyMCE visual editor?

How to link stylesheet to TinyMCE visual editor?

Defaults to ‘editor-style.css’ Allows theme developers to link a custom stylesheet file to the TinyMCE visual editor. The function tests for the existence of the relative path (s) given as the $stylesheet argument against the current theme directory and links the file (s) on success.

How to add a stylesheet to a Gutenberg website?

But it is also possible to place this file in any theme subfolder, like gutenberg/style-editor.css – in this case your add_editor_style () function will look like this: You can make a quick test if your stylesheet has been added to the website just by adding there something like body { background: #000 }

Do you need CSS to create custom blocks in Gutenberg?

When you’re registering your custom blocks in Gutenberg, there is also an option to include CSS styles specifically for that certain block. First of all – unless you are creating your custom plugin, this step is not necessary, because you can put all the styles in style-editor.css file, mentioned above. Creating your custom plugin?

What does the function add editor style do?

The parameter $stylesheet is the name of the stylesheet, relative to the theme root. It also accepts an array of stylesheets. It is optional and defaults to ‘editor-style.css’. This function automatically adds another stylesheet with -rtl prefix, e.g. editor-style-rtl.css.

How to add RTL styles to WordPress stylesheet?

Since version 3.4 the TinyMCE body has .rtl CSS class. It is a better option to use that class and add any RTL styles to the main stylesheet. (array|string) (Optional) Stylesheet name or array thereof, relative to theme root.

How to test the default stylesheet in WordPress?

If no $stylesheet argument is specified, the function will test for the existence of the default editor stylesheet file, editor-style.css, against the current theme directory, and link that file on success.