Skip to content

Commit

Permalink
PDF Dark Mode Style Settings Option
Browse files Browse the repository at this point in the history
  • Loading branch information
damiankorcz committed May 10, 2023
1 parent d70eedf commit 1f37c87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/scss/Info/styleSettingsConfig.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3326,6 +3326,12 @@ settings:
description: This option removes the title from pinned tabs and adds back the default file icon for the markdown files. Helps reduce the horizontal space wasted by pinned tabs. You can still see the title when you hover over the icon. NOTE - This option requires Installer Version 1.1.9+ due to use of CSS `has()`. Also, might not work on certain Mobile clients.
default: false
type: class-toggle
-
id: pt-pdf-dark-theme
title: Enable PDF Dark Theme
description: This option adds styling to the PDF pages by blending in with the colour scheme in Dark mode; making it more eye friendly. This isn't a perfect solution. Note that some images might look inverted and colours be a different shade compared to the original file.
default: false
type: class-toggle
-
id: theme-info
title: Theme Info
Expand Down
8 changes: 8 additions & 0 deletions src/scss/Plugins/Core/PDFViewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,12 @@
box-shadow: unset;
opacity: 0.4;
}

// https://mwichary.medium.com/dark-theme-in-a-day-3518dde2955a
.pt-pdf-dark-theme.theme-dark {
.pdf-viewer .canvasWrapper,
.pdf-sidebar-container img.thumbnailImage {
filter: invert(1) hue-rotate(180deg) saturate(100%);
mix-blend-mode: screen;
}
}

0 comments on commit 1f37c87

Please sign in to comment.