Is it possible to change the color of the toolbar? #111
Replies: 3 comments 3 replies
-
|
That's a good question. The editor supports theming, but I have not gotten to the moment of documenting it properly. The component accepts editor/src/examples/toolbar.tsx Lines 52 to 54 in a152e8a Then, check the respective CSS styling (which happens to be a dark theme). |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I'm also interested in changing the style of the radix toolbar used but I don't see how this can be achieved from from the above. For example I'd like to remove the border-radius and adjust padding. Appreciate any pointers. |
Beta Was this translation helpful? Give feedback.
-
|
I just saw this thread as I am working on editing the toolbar right now and just wanted to mention there is a much more effective way to style the toolbar. The Here's an example of using this in the MDXEditor Component: import './mdx-editor-styles.css';
{/* ...all your other React component code */}
<MDXEditor
ref={richTextInput}
onChange={handleRichText}
markdown={data?.content || ''}
plugins={[
headingsPlugin(),
linkPlugin(),
linkDialogPlugin(),
toolbarPlugin({
toolbarClassName: 'rich-text-toolbar',
toolbarContents: () => (
<>
<UndoRedo />
<BoldItalicUnderlineToggles />
<CreateLink />
</>
),
}),
]}
/>Css file 'mdx-editor-styles.css': .rich-text-toolbar {
border-radius: 5px 5px 0px 0px;
background-color: white;
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I wanted to ask whether there is a way to change the color of the editor toolbar (created by using the toolbar plugin). I tried using Tailwind CSS to style the div that wrapped the toolbar components like so:
Unfortunately, this did not work completely, and the original toolbar with the white/grey color still appeared behind the black
div.. I also tried setting values of the radix ui css color variables and applying these classes to the
MDXEditorvia propcontentEditableClassName. However, I thinkcontentEditableClassNameonly targets the actual text area of the editor and not the toolbar (I saw this behaviour using inspect element).So, is there a way to change the color of the existing provided toolbar, or will I have to style my own toolbar?
Thanks so much for any answers. I would also like to think the project's creator/maintainer for such amazing open source work.
Beta Was this translation helpful? Give feedback.
All reactions