Skip to content

Update Visual Editor Documentation #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions content/guides/2.content/8.visual-editor/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ title: Visual Editor
description: The Directus visual editor module allows you to visually edit the content of your website directly in-place.
---

::callout{icon="material-symbols:info"}
**Beta**
The visual editor module is currently in beta and some functionality is subject to change.
::

<div style="padding:56.33% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/1068823628?badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="Directus-Visual-Editor-Preview"></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>

Making use of the visual editor requires some effort on the part of web developers through two separate but related aspects. These are the [Frontend Library](/guides/content/visual-editor/frontend-library), and the [Studio Module](/guides/content/visual-editor/studio-module) built into Directus.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,8 @@ If you have CSP configured, be sure to make your site available for use inside a

Given this library is built as a Node package, environments that can’t take advantage of NPM will need to take a slightly different approach to including the functionality in their websites.

::callout{icon="material-symbols:info-outline"}
The compiled code for the library can be found in [the git repository](https://github.com/directus/visual-editing/blob/main/dist/visual-editing.js).
::

This can then be included in your website like as follows:

```js
<script src="path-to/visual-editing.js" type="text/javascript"></script>
<script src="https://unpkg.com/@directus/visual-editing" type="text/javascript"></script>
```

```js
Expand Down
6 changes: 6 additions & 0 deletions content/guides/2.content/8.visual-editor/3.customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ The library ships with a number of built in CSS Selectors already applied to its
.directus-visual-editing-rect-hover {
/* class that applies when the original element is hovered */
}

.directus-visual-editing-rect-parent-hover {
/* class that applies to the parent element when the original element is hovered */
}

.directus-visual-editing-rect-inner {
/* the element with the rectangle styles */
}
Expand All @@ -54,6 +59,7 @@ The library also ships with a number of predefined CSS variables. These can be o
--directus-visual-editing--edit-btn--bg-color: #6644ff;
--directus-visual-editing--edit-btn--icon-bg-image: url('data:image/svg+xml,<svg>…</svg>');
--directus-visual-editing--edit-btn--icon-bg-size: 66.6%;
--directus-visual-editing--rect-hover--opacity: 0.333;
}
```

Expand Down