Skip to content

Commit

Permalink
Add smoother transitions between breakpoints
Browse files Browse the repository at this point in the history
This reduces padding when transitioning between layouts, in response to
repeated feedback about misuse of available space.
  • Loading branch information
pradyunsg committed Jul 29, 2024
1 parent d261d3b commit 05a2d63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 10 additions & 7 deletions src/furo/assets/styles/_scaffold.sass
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,14 @@ article
.sidebar-drawer
width: calc((100% - #{$full-width - $sidebar-width}) / 2 + #{$sidebar-width})

@media (max-width: $full-width - $sidebar-width)
@media (max-width: $content-padded-width + $sidebar-width)
// Center the page
.content
margin-left: auto
margin-right: auto
padding: 0 $content-padding--small

@media (max-width: $content-padded-width--small + $sidebar-width)
// Collapse "navigation".
.nav-overlay-icon
display: flex
Expand Down Expand Up @@ -412,23 +419,19 @@ article
.back-to-top
top: calc(var(--header-height) + 0.5rem)

// Center the page, and accommodate for the header.
// Accommodate for the header.
.page
flex-direction: column
justify-content: center
.content
margin-left: auto
margin-right: auto

@media (max-width: $content-width + 2* $content-padding)
@media (max-width: $content-width + 2* $content-padding--small)
// Content should respect window limits.
.content
width: 100%
overflow-x: auto

@media (max-width: $content-width)
.content
padding: 0 $content-padding--small
// Don't float sidebars to the right.
article aside.sidebar
float: none
Expand Down
4 changes: 3 additions & 1 deletion src/furo/assets/styles/variables/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ $content-padding: 3em;
$content-padding--small: 1em;
$content-width: 46em;
$sidebar-width: 15em;
$full-width: $content-width + 2 * ($content-padding + $sidebar-width);
$content-padded-width: $content-width + 2 * $content-padding;
$content-padded-width--small: $content-width + 2 * $content-padding--small;
$full-width: $content-padded-width + 2 * $sidebar-width;

1 comment on commit 05a2d63

@ABD-01
Copy link

@ABD-01 ABD-01 commented on 05a2d63 Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah, update after 3 years!! Dayumn Nice.
I was using your theme and modified the values to completely remove toc-tree.
Today, when I opened your code to refer, I was scratching my head wondering how could I got these values wrong in my code!!

Please sign in to comment.