Skip to content

Commit

Permalink
refactor: give playground a custom theme to satisfy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Dec 10, 2024
1 parent 30de679 commit 4e86d7c
Show file tree
Hide file tree
Showing 8 changed files with 653 additions and 17 deletions.
2 changes: 1 addition & 1 deletion demos/playground/src/RichTextComposer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
} from 'svelte-lexical';
import {prepopulatedRichText} from './prepopulatedRichText';
import type {SettingsStore} from './settings/setttingsStore';
import {editorTheme as PlaygroundEditorTheme} from 'svelte-lexical';
import PlaygroundEditorTheme from './themes/PlaygroundEditorTheme';
import ToolbarPlayground from './ToolbarPlayground.svelte';
import {createWebsocketProvider} from './collaboration';
Expand Down
16 changes: 0 additions & 16 deletions demos/playground/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1738,22 +1738,6 @@ button.item.dropdown-item-active i {
z-index: 3;
}

.PlaygroundEditorTheme__blockCursor {
display: block;
pointer-events: none;
position: absolute;
}

.PlaygroundEditorTheme__blockCursor:after {
content: '';
display: block;
position: absolute;
top: -2px;
width: 20px;
border-top: 1px solid black;
animation: CursorBlink 1.1s steps(2, start) infinite;
}

@keyframes CursorBlink {
to {
visibility: hidden;
Expand Down
13 changes: 13 additions & 0 deletions demos/playground/src/themes/CommentEditorTheme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/

.CommentEditorTheme__paragraph {
margin: 0;
position: 'relative';
}
20 changes: 20 additions & 0 deletions demos/playground/src/themes/CommentEditorTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

import type {EditorThemeClasses} from 'svelte-lexical';

import './CommentEditorTheme.css';

import baseTheme from './PlaygroundEditorTheme';

const theme: EditorThemeClasses = {
...baseTheme,
paragraph: 'CommentEditorTheme__paragraph',
};

export default theme;
Loading

0 comments on commit 4e86d7c

Please sign in to comment.