Is there a way to change the max-width of the editor to be 100%? #1891
-
When I use Editor.JS i find there is always something like |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hi @philmetzger, I believe that the Regarding the full width, you can change the
Hope this helps, |
Beta Was this translation helpful? Give feedback.
-
If you do that all buttons stay at the same place as before ... |
Beta Was this translation helpful? Give feedback.
-
I'm new to editorjs, same problem and I'm testing a solution. For now, I simply add some styles to my page and it works.
|
Beta Was this translation helpful? Give feedback.
-
Editor.js Block Width Customization GuideThis guide helps you set up a custom block width for your Editor.js blocks. By following the steps below, you'll be able to easily modify the width of the blocks in your editor. Steps
/*
Example: editor.css
This CSS controls the width of EditorJS blocks.
You can easily adjust the width by changing the --block-width variable below.
*/
/* Set the block width (default: 780px) */
:root {
--block-width: 780px; /* Change this value to set your desired block width */
}
/* Apply the block width to EditorJS elements */
.ce-block__content, /* Content inside each block */
.ce-block, /* The block wrapper */
.codex-editor__redactor, /* Main editing area */
.ce-toolbar__content { /* Toolbar content for editing */
max-width: var(--block-width); /* Use the block width set in :root */
width: var(--block-width); /* Apply the block width */
margin: 0 auto; /* Center the blocks */
}
/* Adjust the toolbar position in narrow mode (optional) */
.codex-editor--narrow .ce-toolbar__actions {
right: -40px; /* Adjust toolbar position as needed */
} |
Beta Was this translation helpful? Give feedback.
Hi @philmetzger,
I believe that the
max-width
is there to allow for a nice UX as there should be space for the block controls (i.e. tune buttons). However, I am not an EditorJS expert or a maintainer, so hopefully someone with more know-how can tell you about it in greater detail.Regarding the full width, you can change the
max-width
by modifying these classes:Hope this helps,
Goran