Skip to content

Commit

Permalink
Xompatibility with Core Slides plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurankv committed Nov 27, 2023
1 parent d3ecc75 commit 4f89978
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ See this project's [releases](/../../../releases).

## [Unreleased]

### Fixed

- Inline Code right spacing bug fixed

### Added

- Compatibility with slides core plugin

## [1.1.1] - 2023-11-27

### Fixed
Expand Down
5 changes: 3 additions & 2 deletions main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/ReadingView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export async function readingViewCodeblockDecoratingPostProcessor(element: HTMLE
return;

editingEmbeds = editingEmbeds || Boolean(element.matchParent(".cm-embed-block"));
console.log(element);
const specific = !element.querySelector(".view-content > *");
const printing = Boolean(element.querySelector("div.print > *"));
const printing = Boolean(element.querySelector("div.print > *")) || Boolean(element.querySelector("div.slides > *"));
if (printing && !plugin.settings.decoratePrint)
return;

Expand Down
5 changes: 5 additions & 0 deletions src/css/inlineCode.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ body {

.code-styler.code-styler-style-inline .cm-s-obsidian span.cm-inline-code,
.code-styler.code-styler-style-inline .markdown-rendered :not(pre) > code:not([class*="blur"]),
.code-styler.code-styler-style-inline .reveal :not(pre) > code:not([class*="blur"]),
.code-styler.code-styler-style-inline code.code-styler-settings-inline-code {
padding: var(--code-styler-inline-padding-vertical) var(--code-styler-inline-padding-horizontal) !important;
border-radius: var(--code-styler-inline-border-radius) !important;
Expand Down Expand Up @@ -73,3 +74,7 @@ body.code-styler span.code-styler-inline-opener > span > img.code-styler-inline-
.code-styler .cm-s-obsidian span.cm-inline-code .code-styler-inline-parameters {
color: var(--code-comment);
}

.reveal img.code-styler-inline-icon {
margin: inherit;
}
25 changes: 20 additions & 5 deletions src/css/pluginCompatibility.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ pre.code-styler-pre:hover code ~ code.language-output {
margin-bottom: 0;
}
pre.code-styler-pre code ~ code.language-output input.interactive-stdin {
padding: 2px 8px;
padding: 2px 8px;
border-width: 1px;
border-style: solid;
border-color: var(--code-comment);
border-color: var(--code-comment);
border-radius: 5px;
background-color: var(--code-styler-codeblock-background-colour);
color: var(--text-normal);
background-color: var(--code-styler-codeblock-background-colour);
color: var(--text-normal);
}
pre.code-styler-pre code ~ code.language-output hr {
display: none;
Expand Down Expand Up @@ -131,7 +131,7 @@ pre.code-styler-pre div.code-block-highlight-wrap {
clip-path: var(--polygon-in);
opacity: 1;
transform: translateY(-50%);
transition: visibility var(--duration-button), opacity var(--duration-button);
transition: visibility var(--duration-button), opacity var(--duration-button);
visibility: visible;
will-change: margin-right, clip-path;
}
Expand All @@ -158,3 +158,18 @@ div.block-language-include pre.code-styler-pre button.copy-code-button {
div.block-language-include pre.code-styler-pre button.copy-code-button:hover {
margin-right: var(--copy-code-header-right-margin);
}

/** Core Slides Plugin */
.slides button.copy-code-button {
position: absolute;
top: 0;
right: 0;
height: auto;
padding: 6px 8px;
margin: 6px;
background-color: transparent;
box-shadow: none;
color: var(--text-muted);
font-family: var(--font-interface);
font-size: var(--font-ui-smaller);
}
19 changes: 18 additions & 1 deletion styles.css

Large diffs are not rendered by default.

0 comments on commit 4f89978

Please sign in to comment.