Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 35 additions & 49 deletions dist/lite/markedit-preview.js

Large diffs are not rendered by default.

594 changes: 290 additions & 304 deletions dist/markedit-preview.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function applyStyles(html: string) {
stylify(coreCss(styledHtmlColorScheme)),
stylify(previewThemeCss(styledHtmlColorScheme)),
stylify(alertsCss(styledHtmlColorScheme)),
stylify(codeCopyCss(styledHtmlColorScheme)),
stylify(codeCopyCss()),
Comment thread
cyanzhong marked this conversation as resolved.
Comment thread
cyanzhong marked this conversation as resolved.
'</body></html>',
];

Expand Down
11 changes: 2 additions & 9 deletions src/styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import hljsBase from '../styles/hljs/base.css?raw';
import hljsDark from '../styles/hljs/dark.css?raw';

import codeCopyBase from '../styles/code-copy/base.css?raw';
import codeCopyLight from '../styles/code-copy/light.css?raw';
import codeCopyDark from '../styles/code-copy/dark.css?raw';

export type PreviewTheme = typeof previewThemeNames[number];

Expand Down Expand Up @@ -116,13 +114,8 @@ export function hljsCss(colorScheme: ColorScheme = 'auto') {
return createCss(colorScheme, hljsBase, hljsDark).join('\n');
}

export function codeCopyCss(colorScheme: ColorScheme = 'auto') {
const styles = [
codeCopyBase,
...createCss(colorScheme, codeCopyLight, codeCopyDark),
];

return styles.join('\n');
export function codeCopyCss() {
return codeCopyBase;
}
Comment thread
cyanzhong marked this conversation as resolved.
Comment thread
cyanzhong marked this conversation as resolved.

function createCss(colorScheme: ColorScheme, lightCss: string, darkCss: string): string[] {
Expand Down
13 changes: 11 additions & 2 deletions styles/code-copy/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@
right: 6px;
opacity: 0;
transition: opacity 0.2s, background 0.2s;
border: none;
border: 1px solid var(--borderColor-default, ButtonBorder);
border-radius: 8px;
padding: 6px 7px;
background: none;
background: var(--bgColor-muted, Canvas);
color: var(--fgColor-muted, GrayText);

/* Prevent elements from moving during opacity changes in Safari */
will-change: opacity, background;
}

.code-copy-button:hover {
background: var(--bgColor-neutral-muted, ButtonFace);
}

.code-copy-button:active {
background: var(--borderColor-default, ButtonBorder);
}
11 changes: 0 additions & 11 deletions styles/code-copy/dark.css

This file was deleted.

11 changes: 0 additions & 11 deletions styles/code-copy/light.css

This file was deleted.