Skip to content

Commit f4425b3

Browse files
authored
Fix overlap of copy button on CodeBlock component (#2470)
* Add margin if copyable button is visible * Fix text color in current details
1 parent c1117f3 commit f4425b3

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/lib/holocene/code-block.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
): EditorState => {
111111
const extensions = [
112112
keymap.of([...standardKeymap, ...historyKeymap]),
113-
TEMPORAL_THEME(isDark),
113+
TEMPORAL_THEME({ isDark, copyable }),
114114
syntaxHighlighting(TEMPORAL_SYNTAX, { fallback: true }),
115115
indentUnit.of(' '),
116116
closeBrackets(),
@@ -202,7 +202,7 @@
202202
<CopyButton
203203
{copyIconTitle}
204204
{copySuccessIconTitle}
205-
class="absolute right-3 top-1 text-secondary"
205+
class="absolute right-1 top-1 text-secondary"
206206
on:click={handleCopy}
207207
copied={$copied}
208208
/>

src/lib/layouts/workflow-header.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
>
150150
<Icon
151151
name="flag"
152-
class="text-indigo-600/80"
152+
class="text-brand"
153153
width={32}
154154
height={32}
155155
/>{translate('workflows.current-details')}

src/lib/vendor/codemirror/theme.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import colors from 'tailwindcss/colors';
55

66
import { css } from '$lib/theme/utilities';
77

8-
export const TEMPORAL_THEME = (isDark) =>
8+
export const TEMPORAL_THEME = ({
9+
isDark,
10+
copyable,
11+
}: {
12+
isDark: boolean;
13+
copyable: boolean;
14+
}) =>
915
EditorView.theme(
1016
{
1117
'&': {
@@ -22,6 +28,7 @@ export const TEMPORAL_THEME = (isDark) =>
2228
'.cm-content': {
2329
caretColor: css('--color-text-primary'),
2430
fontSize: '0.875em',
31+
...(copyable && { marginRight: '1.75rem' }),
2532
},
2633
'.cm-editor&.cm-focused': {
2734
outline: `3px solid ${colors.indigo['600']}`,

0 commit comments

Comments
 (0)