Skip to content

Commit

Permalink
Clean up sidebar rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 23, 2023
1 parent da8dc30 commit 0cb65de
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 83 deletions.
78 changes: 20 additions & 58 deletions assets/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ body {
left: 0;
transition: all var(--sidebarTransitionDuration) ease-in-out;
will-change: transform;
margin-top: 12px;
margin-top: 10px;
}

.content {
Expand All @@ -56,10 +56,22 @@ body {
z-index: 3;
}

.content-inner {
max-width: var(--content-width);
margin: 0 auto;
padding: 3px var(--content-gutter);
}

.content-inner:focus {
outline: none;
}

.content-outer {
min-height: 100%;
}

body:is(.sidebar-opening, .sidebar-opened) .sidebar-button {
transform: translateX(
calc(var(--sidebarWidth) - 100% - var(--sidebarButtonRightOpen))
);
transform: translateX(calc(var(--sidebarWidth) - 100% - var(--sidebarButtonRightOpen)));
}

body.sidebar-opening-start .sidebar {
Expand Down Expand Up @@ -107,58 +119,8 @@ body.sidebar-closed .content {
left: 0;
}

.content-inner {
max-width: var(--content-width);
margin: 0 auto;
padding: 3px var(--content-gutter);
}

.content-inner:focus {
outline: none;
}

.content-outer {
min-height: 100%;
}

@media screen and (max-width: 768px) {

.sidebar-button {
position: absolute;
top: 4px;
left: -1px;
}

.sidebar-button:before {
--sidebarButtonHeight: 60px;
content: "";
display: block;
z-index: -1;
pointer-events: none;
position: fixed;
left: -1px;
top: 0;
height: var(--sidebarButtonHeight);
width: calc(100vw + 2px);
transition: top var(--sidebarTransitionDuration) ease-in-out;
}

body:is(.sidebar-closed, .sidebar-closing) .sidebar-button:before {
top: 0;
}

body:is(.sidebar-opening, .sidebar-opened) .sidebar-button:before {
top: calc(-1 * var(--sidebarButtonHeight) - var(--sidebarButtonTopOpen));
}

body.sidebar-opened .sidebar-button:before {
opacity: 0;
}
}

body.search-focused .search-bar .search-close-button {
transform: scaleY(1);
transition: transform 0.15s ease-out 0.15s;
body.sidebar-closed .sidebar-button {
margin: 10px 8px;
}

@media screen and (max-width: 768px) {
Expand All @@ -169,8 +131,8 @@ body.search-focused .search-bar .search-close-button {
}

.content-inner {
padding-top: 10px;
padding-bottom: 27px;
padding-top: 13px;
padding-bottom: 26px;
overflow-x: auto;
}
}
17 changes: 11 additions & 6 deletions assets/css/search-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}

.top-search .search-bar .search-input:focus {
border: 1px solid var(--searchBarFocusColor);
border: 1px solid var(--searchBarFocusColor);
border-radius: 8px;
height: 48px;
position: relative;
Expand All @@ -51,7 +51,7 @@
border: none;
cursor: pointer;
left: 11px;
opacity: .5;
opacity: 0.5;
padding: 5px 1px 5px 5px;
position: absolute;
top: 60%;
Expand All @@ -74,17 +74,17 @@
cursor: pointer;
right: 11px;
margin: 0;
opacity: .5;
opacity: 0.5;
padding: 5px 1px 5px 0;
position: absolute;
transform: scaleY(0);
top: calc(50% - 11px);
transition: .15s transform ease-out;
transition: 0.15s transform ease-out;
z-index: 2;
}

.top-search .search-bar .search-close-button:hover {
opacity: .7;
opacity: 0.7;
}

.top-search .search-settings button.icon-settings {
Expand All @@ -99,7 +99,7 @@
color: var(--iconAction);
text-decoration: none;
border: none;
transition: color .3s ease-in-out;
transition: color 0.3s ease-in-out;
background-color: transparent;
cursor: pointer;
padding: 0;
Expand All @@ -123,3 +123,8 @@
margin-top: 0;
}
}

body.search-focused .search-bar .search-close-button {
transform: scaleY(1);
transition: transform 0.15s ease-out 0.15s;
}
7 changes: 0 additions & 7 deletions assets/css/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@

.sidebar-closed .sidebar-button {
color: var(--contrast);
margin: 12px 8px 8px 8px;
}

@media screen and (max-height: 500px) {
Expand All @@ -423,9 +422,3 @@
overflow: visible;
}
}

@media screen and (max-width: 768px) {
.sidebar-closed .sidebar-button {
margin: 8px;
}
}
6 changes: 0 additions & 6 deletions formatters/html/dist/html-elixir-3ZLIM5JF.css

This file was deleted.

6 changes: 6 additions & 0 deletions formatters/html/dist/html-elixir-DQ62LQ65.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions formatters/html/dist/html-erlang-FM3BISIB.css

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions formatters/html/dist/html-erlang-VAH6CVO2.css

This file was deleted.

0 comments on commit 0cb65de

Please sign in to comment.