Skip to content

Commit

Permalink
Tweak how icons are handled and aligned
Browse files Browse the repository at this point in the history
This makes the sizes make more sense based on past commit messages and
aligns the theme icons vertically.
  • Loading branch information
pradyunsg committed May 16, 2024
1 parent 38f17af commit 0439e84
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/furo/assets/styles/_scaffold.sass
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
// causing the content to stutter horizontally between taller-than-viewport and
// not-taller-than-viewport pages.
$icon-size: 1.25rem

html
overflow-x: hidden
overflow-y: scroll
Expand Down Expand Up @@ -195,24 +193,25 @@ article
display: none

.theme-toggle-container
vertical-align: middle
display: flex

.theme-toggle
display: flex
cursor: pointer
border: none
padding: 0
background: transparent

.theme-toggle svg
vertical-align: middle
height: $icon-size
width: $icon-size
height: 1.25rem
width: 1.25rem
color: var(--color-foreground-primary)
display: none

.theme-toggle-header
float: left
padding: 1rem 0.5rem
display: flex
align-items: center
justify-content: center

////////////////////////////////////////////////////////////////////////////////
// Toggles for elements
Expand All @@ -223,8 +222,8 @@ article

.icon
color: var(--color-foreground-secondary)
height: $icon-size
width: $icon-size
height: 1.5rem
width: 1.5rem

.toc-header-icon, .nav-overlay-icon
// for when we set display: flex
Expand All @@ -246,8 +245,8 @@ article
.edit-this-page, .view-this-page
svg
color: inherit
height: $icon-size
width: $icon-size
height: 1.25rem
width: 1.25rem

.sidebar-toggle
position: absolute
Expand Down Expand Up @@ -377,12 +376,10 @@ article
left: -$sidebar-width

// Swap which icon is visible.
.toc-header-icon
.toc-header-icon, .theme-toggle-header
display: flex
.toc-content-icon, .theme-toggle-content
display: none
.theme-toggle-header
display: block

// Show the header.
.mobile-header
Expand All @@ -404,8 +401,8 @@ article

.nav-overlay-icon .icon,
.theme-toggle svg
height: $icon-size
width: $icon-size
height: 1.5rem
width: 1.5rem

// Add a scroll margin for the content
:target
Expand Down

0 comments on commit 0439e84

Please sign in to comment.