Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update how horizontal scrollbars work for code and tables #77

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
64 changes: 40 additions & 24 deletions boostlook.css
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,6 @@ p, h1, h2, h3, h4, h5, h6 {
padding: 1.2em .8em;
font-family: "Noto Sans Mono", monospace;
margin-bottom: 1.25rem;
overflow-x: auto !important;
scrollbar-width: none !important;
}

/* Emphasis within code */
Expand Down Expand Up @@ -858,19 +856,54 @@ html:has(#docsiframe) {
background-color: var(--bl-scrollbar-track-color);
}

/* Inline Code Elements */
/* Code Elements */

.boostlook .doc pre,
.boostlook p code,
.boostlook table code,
.boostlook p tt,
.boostlook p kbd,
.boostlook p samp,
.boostlook p pre {
overflow-x: hidden;
.boostlook p pre,
.boostlook:not(:has(.doc)) pre,
.boostlook code,
.boostlook pre code,
.boostlook .doc .content pre code,
.boostlook#libraryReadMe pre code {
overflow-x: auto;
scrollbar-color: var(--bl-pre-background) var(--bl-pre-background);
scrollbar-width: thin;
}

.boostlook .doc pre:hover,
.boostlook p code:hover,
.boostlook table code:hover,
.boostlook p tt:hover,
.boostlook p kbd:hover,
.boostlook p samp:hover,
.boostlook p pre:hover,
.boostlook p pre:hover code,
.boostlook code:hover,
.boostlook pre code:hover,
.boostlook .doc .content pre code:hover,
.boostlook:not(:has(.doc)) pre:hover,
.boostlook#libraryReadMe pre code:hover {
scrollbar-color: var(--bl-scrollbar-thumb-color) var(--bl-pre-background);
}

/* Table Container */
.boostlook .content div:has(> table) {
overflow-x: auto;
.boostlook .content div:has(> table),
.boostlook .doc table.tableblock,
.boostlook #content .sect3:has(.tableblock) {
overflow-x: auto !important;
scrollbar-color: var(--bl-background) var(--bl-background);
scrollbar-width: thin;
}

.boostlook .content div:has(> table):hover,
.boostlook .doc table.tableblock:hover,
.boostlook #content .sect3:has(.tableblock):hover {
scrollbar-color: var(--bl-scrollbar-thumb-color) var(--bl-scrollbar-track-color);
}

/* Asciidoc template - Content overflow handling */
Expand All @@ -880,14 +913,6 @@ html:has(#docsiframe) {
height: 100vh;
}

/* Hide scrollbars but keep functionality */
.boostlook code::-webkit-scrollbar,
.boostlook pre code::-webkit-scrollbar,
.boostlook .doc .content pre code::-webkit-scrollbar {
width: 0;
height: 0;
}

/*----------------- Styles specific to AsciiDoctor content start -----------------*/

/**
Expand Down Expand Up @@ -916,8 +941,6 @@ html:has(#docsiframe) {
background-color: var(--bl-pre-background);
margin-bottom: 1.25rem;
padding: 1rem;
overflow-x: auto;
scrollbar-width: none;
border-color: var(--bl-code-border-color);
}

Expand Down Expand Up @@ -1030,11 +1053,6 @@ html:has(#docsiframe) {
margin-bottom: 16px;
}

/* Table Container */
.boostlook #content .sect3:has(.tableblock) {
overflow-x: auto;
}

/* Legacy Documentation Titles */
#boost-legacy-docs-wrapper h2.title {
margin-top: 0;
Expand Down Expand Up @@ -1289,7 +1307,6 @@ html:has(#docsiframe) {

.boostlook .doc pre {
padding: initial;
overflow-x: hidden;
}

/* Layout */
Expand Down Expand Up @@ -1337,7 +1354,6 @@ html:has(#docsiframe) {
/* Tables */
.boostlook .doc table.tableblock {
display: block;
overflow-x: auto;
margin-bottom: 1.5rem;
margin-top: 1rem;
}
Expand Down