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

refactor: remove custom scrollbars #1337

Merged
merged 2 commits into from
May 26, 2023
Merged
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
36 changes: 0 additions & 36 deletions src/pydata_sphinx_theme/assets/styles/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,6 @@
* SASS Mixins
*********************************************/

/**
* Scrollbars should be thinner and slightly rounded, with a grey background
* ref: https://www.nngroup.com/articles/scrolling-and-scrollbars/
*/
@mixin scrollbar-style() {
&::-webkit-scrollbar {
width: 0.5rem;
height: 0.5rem;
}

&::-webkit-scrollbar-thumb {
background: var(--pst-color-text-muted);
border-radius: 0.25rem;
}

&::-webkit-scrollbar-track {
background: transparent;
}

&::-webkit-scrollbar-thumb {
background: var(--pst-color-on-surface);
}

// Hovering behavior for the scrollbar
// Include both hovering on the parent and on the thumb in case thumb is outside parent
&:hover {
&::-webkit-scrollbar-thumb {
background: var(--pst-color-text-muted);
}
}

&::-webkit-scrollbar-thumb:hover {
background: var(--pst-color-text-muted);
}
}

/**
* A consistent box shadow style we apply across elements.
*/
Expand Down
4 changes: 0 additions & 4 deletions src/pydata_sphinx_theme/assets/styles/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ body {
display: flex;
flex-direction: column;

@include scrollbar-style();

// hack to avoid the black background on some browser including Safari
&::-webkit-scrollbar-track {
background: var(--pst-color-background);
Expand Down Expand Up @@ -170,8 +168,6 @@ pre {
border: 1px solid var(--pst-color-border);
border-radius: $admonition-border-radius;

@include scrollbar-style();

.linenos {
opacity: 0.5;
padding-right: 10px;
Expand Down
2 changes: 1 addition & 1 deletion src/pydata_sphinx_theme/assets/styles/content/_math.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ div.math {
flex-grow: 1;
padding-bottom: 0.2rem;
overflow: auto;
@include scrollbar-style();

// Set height to 0 so that it does not cause scrollbars to appear
// ref: https://github.com/mathjax/MathJax/issues/2521
mjx-assistive-mml {
Expand Down
2 changes: 0 additions & 2 deletions src/pydata_sphinx_theme/assets/styles/content/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ table {
max-width: 100%;
overflow: auto;

@include scrollbar-style();

// default to table-center
margin-left: auto;
margin-right: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ div.nblast.container {
div.cell_output .output {
max-width: 100%;
overflow-x: auto;

@include scrollbar-style();
}

// Dark theme special-cases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
border-right: 1px solid var(--pst-color-border);
background-color: var(--pst-color-background);
overflow-y: auto;
@include scrollbar-style();

font-size: var(--pst-sidebar-font-size-mobile);
@include media-breakpoint-up($breakpoint-sidebar-primary) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
// Color and border
background-color: var(--pst-color-background);
overflow-y: auto;

@include scrollbar-style();
}

.sidebar-secondary-item {
Expand Down