Skip to content

Commit

Permalink
refactor: remove custom scrollbars (#1337)
Browse files Browse the repository at this point in the history
* refactor: remove scrollbar customization

* remove the mixin method
  • Loading branch information
12rambau authored May 26, 2023
1 parent 43fbab8 commit 5facdea
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 48 deletions.
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

0 comments on commit 5facdea

Please sign in to comment.