Skip to content
Open
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
Binary file added assets/colorshift-update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/plugin/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default class HighlightrPlugin extends Plugin {
prefix:
this.settings.highlighterMethods === "css-classes"
? `<mark class="hltr-${highlighterKey.toLowerCase()}">`
: `<mark style="background: ${this.settings.highlighters[highlighterKey]};">`,
: `<mark style="color: ${this.settings.highlighters[highlighterKey]}; background: ${this.settings.highlighters[highlighterKey]};">`,
suffix: "</mark>",
},
};
Expand Down Expand Up @@ -197,6 +197,10 @@ export default class HighlightrPlugin extends Plugin {
"highlightr-realistic",
this.settings.highlighterStyle === "realistic"
);
document.body.classList.toggle(
"highlightr-colorshift",
this.settings.highlighterStyle === "colorshift"
);
};

onunload() {
Expand Down
1 change: 1 addition & 0 deletions src/settings/settingsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const HIGHLIGHTER_STYLES = [
"floating",
"rounded",
"realistic",
"colorshift"
];

export const HIGHLIGHTER_METHODS = ["css-classes", "inline-styles"];
Expand Down
3 changes: 2 additions & 1 deletion src/settings/settingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export class HighlightrSettingTab extends PluginSettingTab {
<span style="background:#FFB7EACC;padding: .125em .125em;--lowlight-background: var(--background-primary);border-radius: 0;background-image: linear-gradient(360deg,rgba(255, 255, 255, 0) 40%,var(--lowlight-background) 40%) !important;">Lowlight</span>
<span style="background:#93C0FFCC;--floating-background: var(--background-primary);border-radius: 0;padding-bottom: 5px;background-image: linear-gradient(360deg,rgba(255, 255, 255, 0) 28%,var(--floating-background) 28%) !important;">Floating</span>
<span style="background:#9CF09CCC;margin: 0 -0.05em;padding: 0.1em 0.4em;border-radius: 0.8em 0.3em;-webkit-box-decoration-break: clone;box-decoration-break: clone;text-shadow: 0 0 0.75em var(--background-primary-alt);">Realistic</span>
<span style="background:#CCA9FFCC;margin: 0 -0.05em;padding: 0.125em 0.15em;border-radius: 0.2em;-webkit-box-decoration-break: clone;box-decoration-break: clone;">Rounded</span>`;
<span style="background:#CCA9FFCC;margin: 0 -0.05em;padding: 0.125em 0.15em;border-radius: 0.2em;-webkit-box-decoration-break: clone;box-decoration-break: clone;">Rounded</span>
<span style="color:#FF5582A6;margin: 0 -0.05em;padding: 0.125em 0.15em;border-radius: 0.2em;-webkit-box-decoration-break: clone;box-decoration-break: clone;font-weight:bold;">ColorShift</span>`;
return d;
};

Expand Down
17 changes: 15 additions & 2 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
rgba(255, 255, 255, 0) 40%,
var(--lowlight-background) 40%
) !important;
color: unset !important;
}

.highlightr-lowlight .workspace-split.mod-left-split mark,
Expand Down Expand Up @@ -42,9 +43,10 @@
padding-bottom: 5px;
background-image: linear-gradient(
360deg,
rgba(255, 255, 255, 0) 28%,
var(--floating-background) 28%
rgba(255, 255, 255, 0) 14%,
var(--floating-background) 14%
) !important;
color: unset !important;
}

.highlightr-floating .workspace-split.mod-left-split mark,
Expand Down Expand Up @@ -76,6 +78,7 @@
border-radius: 0.2em;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
color: unset !important;
}

.highlightr-rounded span.cm-highlight {
Expand Down Expand Up @@ -104,6 +107,7 @@
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
text-shadow: 0 0 0.75em var(--background-primary-alt);
color: unset !important;
}

.highlightr-realistic.hide-tokens .cm-s-obsidian span.cm-highlight,
Expand Down Expand Up @@ -139,6 +143,15 @@

/**/

/*colorshift*/
.highlightr-colorshift mark,
.highlightr-colorshift .markdown-preview-view mark {
background: unset !important;
font-weight: bold;
}

/**/

button.copy-highlights {
padding: 4px 14px;
border-radius: 5px;
Expand Down