Skip to content

Commit

Permalink
feat: support custom style
Browse files Browse the repository at this point in the history
  • Loading branch information
lynhan318 committed Apr 12, 2024
1 parent 40858fe commit 562318a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/svelte/src/lib/node-view/FloatingRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {BubbleMenu} from '$lib/components';
import {EditorContextKey} from '$lib/context';
import {
computePosition,
Expand Down Expand Up @@ -39,6 +38,7 @@ class FloatingRenderer {
component: ComponentType;
editor: Editor;
portal?: HTMLElement;
style?: Partial<CSSStyleDeclaration>;
},
private readonly floatingOptions?: Partial<ComputePositionConfig>
) {
Expand All @@ -47,7 +47,8 @@ class FloatingRenderer {
Object.assign(this.wrapper.style, {
opacity: 0,
position: 'absolute',
transition: 'opacity 0.2s ease-in-out'
transition: 'opacity 0.2s ease-in-out',
...opts.style
});
(opts.portal || document.body).appendChild(this.wrapper);
}
Expand Down

0 comments on commit 562318a

Please sign in to comment.