Skip to content

Commit ac6fdb0

Browse files
authored
Add quicklook-toolbar-inset for breathing (#132)
1 parent 5d757f6 commit ac6fdb0

3 files changed

Lines changed: 24 additions & 12 deletions

File tree

dist/lite/markedit-preview.js

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/markedit-preview.js

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styles/quicklook.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ body {
1212
--quicklook-default-zoom: 0.9;
1313
zoom: var(--quicklook-default-zoom);
1414

15-
/* Pull content under the toolbar (scroller stays inset to keep its scrollbar clear) */
16-
margin-top: calc(-1 * var(--editor-inset-top) * var(--quicklook-default-zoom) / var(--quicklook-zoom, var(--quicklook-default-zoom))) !important;
17-
/* Restore the height the negative margin removed so bouncing stays in the pane, not the page */
18-
min-height: calc(100% + var(--editor-inset-top) + 1px);
15+
/* Toolbar clearance minus the inset, normalized so it stays constant under pinch-zoom */
16+
--quicklook-toolbar-inset: 8px;
17+
--quicklook-toolbar-clearance: calc((var(--editor-inset-top) - var(--quicklook-toolbar-inset)) * var(--quicklook-default-zoom) / var(--quicklook-zoom, var(--quicklook-default-zoom)));
18+
/* Scroll content under the toolbar; scroller stays inset so its scrollbar is clear */
19+
margin-top: calc(-1 * var(--quicklook-toolbar-clearance)) !important;
20+
/* Add the clearance back so the bounce stays in the pane, not the page */
21+
min-height: calc(100% + var(--quicklook-toolbar-clearance) + 1px);
1922
}
2023

2124
/* Links are not interactive in quicklook */
@@ -104,6 +107,7 @@ body {
104107

105108
.quicklook .markdown-body.overlay > .quicklook-content {
106109
--quicklook-default-zoom: 0.8;
110+
--quicklook-toolbar-inset: 0px;
107111
}
108112

109113
.quicklook-toolbar {

0 commit comments

Comments
 (0)