diff options
author | johannst <johannst@users.noreply.github.com> | 2022-08-23 19:48:10 +0000 |
---|---|---|
committer | johannst <johannst@users.noreply.github.com> | 2022-08-23 19:48:10 +0000 |
commit | 25b609d0c70d49dd62479ce03578704e62712bd8 (patch) | |
tree | f9c761f5c72ded4cf9c31bad9f15109cf810b55c /css | |
parent | f647a8c45dda58078c86a96c68ae00ea1c69a222 (diff) | |
download | notes-25b609d0c70d49dd62479ce03578704e62712bd8.tar.gz notes-25b609d0c70d49dd62479ce03578704e62712bd8.zip |
deploy: 6f6fef7bb61712038220a7607447d38689ad6978
Diffstat (limited to 'css')
-rw-r--r-- | css/chrome.css | 86 | ||||
-rw-r--r-- | css/general.css | 56 | ||||
-rw-r--r-- | css/variables.css | 22 |
3 files changed, 123 insertions, 41 deletions
diff --git a/css/chrome.css b/css/chrome.css index 3ff5992..10fa4b3 100644 --- a/css/chrome.css +++ b/css/chrome.css @@ -20,14 +20,13 @@ a > .hljs { /* Menu Bar */ -#menu-bar { - position: -webkit-sticky; - position: sticky; - top: 0; +#menu-bar, +#menu-bar-hover-placeholder { z-index: 101; margin: auto calc(0px - var(--page-padding)); } -#menu-bar > #menu-bar-sticky-container { +#menu-bar { + position: relative; display: flex; flex-wrap: wrap; background-color: var(--bg); @@ -35,10 +34,21 @@ a > .hljs { border-bottom-width: 1px; border-bottom-style: solid; } -.js #menu-bar > #menu-bar-sticky-container { - transition: transform 0.3s; +#menu-bar.sticky, +.js #menu-bar-hover-placeholder:hover + #menu-bar, +.js #menu-bar:hover, +.js.sidebar-visible #menu-bar { + position: -webkit-sticky; + position: sticky; + top: 0 !important; } -#menu-bar.bordered > #menu-bar-sticky-container { +#menu-bar-hover-placeholder { + position: sticky; + position: -webkit-sticky; + top: 0; + height: var(--menu-bar-height); +} +#menu-bar.bordered { border-bottom-color: var(--table-border-color); } #menu-bar i, #menu-bar .icon-button { @@ -72,10 +82,6 @@ a > .hljs { text-decoration: none; } -html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-container { - transform: translateY(calc(-10px - var(--menu-bar-height))); -} - .left-buttons { display: flex; margin: 0 5px; @@ -87,7 +93,7 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta .menu-title { display: inline-block; font-weight: 200; - font-size: 2rem; + font-size: 2.4rem; line-height: var(--menu-bar-height); text-align: center; margin: 0; @@ -202,24 +208,63 @@ pre { pre > .buttons { position: absolute; z-index: 100; - right: 5px; - top: 5px; + right: 0px; + top: 2px; + margin: 0px; + padding: 2px 0px; color: var(--sidebar-fg); cursor: pointer; + visibility: hidden; + opacity: 0; + transition: visibility 0.1s linear, opacity 0.1s linear; +} +pre:hover > .buttons { + visibility: visible; + opacity: 1 } pre > .buttons :hover { color: var(--sidebar-active); + border-color: var(--icons-hover); + background-color: var(--theme-hover); } pre > .buttons i { margin-left: 8px; } pre > .buttons button { - color: inherit; - background: transparent; - border: none; cursor: inherit; + margin: 0px 5px; + padding: 3px 5px; + font-size: 14px; + + border-style: solid; + border-width: 1px; + border-radius: 4px; + border-color: var(--icons); + background-color: var(--theme-popup-bg); + transition: 100ms; + transition-property: color,border-color,background-color; + color: var(--icons); +} +@media (pointer: coarse) { + pre > .buttons button { + /* On mobile, make it easier to tap buttons. */ + padding: 0.3rem 1rem; + } +} +pre > code { + padding: 1rem; +} + +/* FIXME: ACE editors overlap their buttons because ACE does absolute + positioning within the code block which breaks padding. The only solution I + can think of is to move the padding to the outer pre tag (or insert a div + wrapper), but that would require fixing a whole bunch of CSS rules. +*/ +.hljs.ace_editor { + padding: 0rem 0rem; } + pre > .result { margin-top: 10px; } @@ -417,6 +462,11 @@ ul#searchresults span.teaser em { display: none; } +.chapter li.chapter-item { + line-height: 1.5em; + margin-top: 0.6em; +} + .chapter li.expanded > a.toggle div { transform: rotate(90deg); } diff --git a/css/general.css b/css/general.css index e0bb851..0e4f07a 100644 --- a/css/general.css +++ b/css/general.css @@ -12,6 +12,7 @@ html { color: var(--fg); background-color: var(--bg); text-size-adjust: none; + -webkit-text-size-adjust: none; } body { @@ -25,11 +26,26 @@ code { font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */ } +/* make long words/inline code not x overflow */ +main { + overflow-wrap: break-word; +} + +/* make wide tables scroll if they overflow */ +.table-wrapper { + overflow-x: auto; +} + +/* Don't change font size in headers. */ +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + font-size: unset; +} + .left { float: left; } .right { float: right; } .boring { opacity: 0.6; } .hide-boring .boring { display: none; } -.hidden { display: none; } +.hidden { display: none !important; } h2, h3 { margin-top: 2.5em; } h4, h5 { margin-top: 2em; } @@ -40,26 +56,30 @@ h4, h5 { margin-top: 2em; } margin-top: 1em; } -h1 a.header:target::before, -h2 a.header:target::before, -h3 a.header:target::before, -h4 a.header:target::before { +h1:target::before, +h2:target::before, +h3:target::before, +h4:target::before, +h5:target::before, +h6:target::before { display: inline-block; content: "ยป"; margin-left: -30px; width: 30px; } -h1 a.header:target, -h2 a.header:target, -h3 a.header:target, -h4 a.header:target { +/* This is broken on Safari as of version 14, but is fixed + in Safari Technology Preview 117 which I think will be Safari 14.2. + https://bugs.webkit.org/show_bug.cgi?id=218076 +*/ +:target { scroll-margin-top: calc(var(--menu-bar-height) + 0.5em); } .page { outline: 0; padding: 0 var(--page-padding); + margin-top: calc(0px - var(--menu-bar-height)); /* Compensate for the #menu-bar-hover-placeholder */ } .page-wrapper { box-sizing: border-box; @@ -70,17 +90,19 @@ h4 a.header:target { .content { overflow-y: auto; - padding: 0 15px; - padding-bottom: 50px; + padding: 0 5px 50px 5px; } .content main { margin-left: auto; margin-right: auto; max-width: var(--content-max-width); } +.content p { line-height: 1.45em; } +.content ol { line-height: 1.45em; } +.content ul { line-height: 1.45em; } .content a { text-decoration: none; } .content a:hover { text-decoration: underline; } -.content img { max-width: 100%; } +.content img, .content video { max-width: 100%; } .content .header:link, .content .header:visited { color: var(--fg); @@ -157,3 +179,13 @@ blockquote { .tooltipped .tooltiptext { visibility: visible; } + +.chapter li.part-title { + color: var(--sidebar-fg); + margin: 5px 0px; + font-weight: bold; +} + +.result-no-output { + font-style: italic; +} diff --git a/css/variables.css b/css/variables.css index 9534ec8..56b634b 100644 --- a/css/variables.css +++ b/css/variables.css @@ -67,7 +67,7 @@ --links: #2b79a2; - --inline-code-color: #c5c8c6;; + --inline-code-color: #c5c8c6; --theme-popup-bg: #141617; --theme-popup-border: #43484d; @@ -92,22 +92,22 @@ .light { --bg: hsl(0, 0%, 100%); - --fg: #333333; + --fg: hsl(0, 0%, 0%); --sidebar-bg: #fafafa; - --sidebar-fg: #364149; + --sidebar-fg: hsl(0, 0%, 0%); --sidebar-non-existant: #aaaaaa; - --sidebar-active: #008cff; + --sidebar-active: #1f1fff; --sidebar-spacer: #f4f4f4; - --scrollbar: #cccccc; + --scrollbar: #8F8F8F; - --icons: #cccccc; - --icons-hover: #333333; + --icons: #747474; + --icons-hover: #000000; - --links: #4183c4; + --links: #20609f; - --inline-code-color: #6e6b5e; + --inline-code-color: #301900; --theme-popup-bg: #fafafa; --theme-popup-border: #cccccc; @@ -147,7 +147,7 @@ --links: #2b79a2; - --inline-code-color: #c5c8c6;; + --inline-code-color: #c5c8c6; --theme-popup-bg: #161923; --theme-popup-border: #737480; @@ -228,7 +228,7 @@ --links: #2b79a2; - --inline-code-color: #c5c8c6;; + --inline-code-color: #c5c8c6; --theme-popup-bg: #141617; --theme-popup-border: #43484d; |