Skip to content

Commit 26e909a

Browse files
committed
use dark graghite for screenshots
1 parent 98ed448 commit 26e909a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

codex-ui/src/vue/components/editor/Editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ defineExpose({
8080
/**
8181
* Returns the editor holder
8282
*/
83-
element: editorComponent,
83+
element: editorComponent.value,
8484
});
8585
</script>
8686

src/infrastructure/utils/screenshot.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export async function makeElementScreenshot(element: HTMLElement, containerStyle
1212
*/
1313
const screenshotContainer = document.createElement('div');
1414

15+
screenshotContainer.setAttribute('color-scheme', 'dark');
16+
screenshotContainer.setAttribute('theme-base', 'graphite');
17+
screenshotContainer.setAttribute('theme-accent', 'sky');
18+
1519
/**
1620
* Assign passed styles to container
1721
*/

src/presentation/pages/Note.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</template>
4141

4242
<script lang="ts" setup>
43-
import { ref, toRef, watch, toValue } from 'vue';
43+
import { ref, toRef, watch } from 'vue';
4444
import { Button, Editor } from 'codex-ui/vue';
4545
import useNote from '@/application/services/useNote';
4646
import { useRouter } from 'vue-router';
@@ -122,7 +122,7 @@ async function noteChanged(data: NoteContent): Promise<void> {
122122
/**
123123
* Get html element with note
124124
*/
125-
const editorElement = editor.value ? toValue(editor.value.element) : null;
125+
const editorElement = editor.value ? editor.value.element : null;
126126
127127
if (!isEmpty) {
128128
await save(data, props.parentId);
@@ -133,6 +133,7 @@ async function noteChanged(data: NoteContent): Promise<void> {
133133
if (editorElement !== null) {
134134
updatedNoteCover = await makeElementScreenshot(editorElement, {
135135
background: 'var(--base--bg-primary)',
136+
color: 'var(--base--text)',
136137
display: 'flex',
137138
justifyContent: 'center',
138139
width: '1200px',

0 commit comments

Comments
 (0)