Skip to content

Commit

Permalink
Merge pull request #50 from DiggesT/fix/css-namespace
Browse files Browse the repository at this point in the history
CSS namespaces
  • Loading branch information
ozanyurtsever authored Oct 2, 2023
2 parents f8780f2 + fd8ff2c commit 391ed49
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
2 changes: 2 additions & 0 deletions src/EditorComposer.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

@import 'https://fonts.googleapis.com/css?family=Reenie+Beanie';

@namespace "Verbum-EditorComposer";

.editor-shell {
margin: 20px auto;
border-radius: 2px;
Expand Down
4 changes: 3 additions & 1 deletion src/EditorComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const EditorComposer = ({ children, initialEditorState }: IEditorComposer) => {
return (
<LexicalComposer initialConfig={initialConfig}>
<I18nextProvider i18n={i18n}>
<div className="editor-shell">{children}</div>
<svg xmlns="Verbum-EditorComposer">
<div className="editor-shell">{children}</div>
</svg>
</I18nextProvider>
</LexicalComposer>
);
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/ToolbarPlugin/ToolbarPlugin.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*
*
*/
@namespace 'Verbum-toolbar';

.ToolbarPlugin__dialogActions {
display: flex;
flex-direction: row;
Expand Down
43 changes: 23 additions & 20 deletions src/plugins/ToolbarPlugin/ToolbarPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,26 +265,29 @@ const ToolbarPlugin = ({
blockType,
}}
>
<div className="toolbar">
<UndoButton />
<RedoButton />
<Divider />
{supportedBlockTypes.has(blockType) && activeEditor === initialEditor && (
<>
<BlockFormatDropdown />
<Divider />
</>
)}
{blockType === 'code' ? (
<>
<CodeLanguageDropdown />
<Divider />
{alignExists && AlignComponent}
</>
) : (
<>{children}</>
)}
</div>
<svg xmlns="Verbum-toolbar">
<div className="toolbar">
<UndoButton />
<RedoButton />
<Divider />
{supportedBlockTypes.has(blockType) &&
activeEditor === initialEditor && (
<>
<BlockFormatDropdown />
<Divider />
</>
)}
{blockType === 'code' ? (
<>
<CodeLanguageDropdown />
<Divider />
{alignExists && AlignComponent}
</>
) : (
<>{children}</>
)}
</div>
</svg>
</ToolbarContext.Provider>
);
};
Expand Down

0 comments on commit 391ed49

Please sign in to comment.