mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-12 21:03:32 -06:00
Add nav_enabled
variables for more customizable and feature-complete minimal layouts (#1441)
* Add nav_enabled variables for site/layout/page-level control * _sass: Add a space around `+` operator * assets: Do not compile based on site.nav_enabled * _config.yml: nav_enabled can be selectively enabled * CHANGELOG.md: Add nav_enabled feature and docs * docs: Prefer em dash in describing minimal layout * docs: Add section on Selectively hiding or showing the sidebar * _layouts: Display sidebar based on variable importance * docs: Update documentation on the minimal layout * docs: Document site.nav_enabled configuration variable --------- Co-authored-by: Matt Wang <matt@matthewwang.me>
This commit is contained in:
@@ -19,23 +19,48 @@
|
||||
width: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width});
|
||||
min-width: $nav-width;
|
||||
}
|
||||
|
||||
& + .main {
|
||||
@include mq(md) {
|
||||
margin-left: $nav-width-md;
|
||||
}
|
||||
|
||||
@include mq(lg) {
|
||||
// stylelint-disable function-name-case
|
||||
// disable for Max(), we want to use the CSS max() function
|
||||
margin-left: Max(
|
||||
#{$nav-width},
|
||||
calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width})
|
||||
);
|
||||
// stylelint-enable function-name-case
|
||||
}
|
||||
|
||||
.main-header {
|
||||
display: none;
|
||||
background-color: $sidebar-color;
|
||||
|
||||
@include mq(md) {
|
||||
display: flex;
|
||||
background-color: $body-background-color;
|
||||
}
|
||||
|
||||
&.nav-open {
|
||||
display: block;
|
||||
|
||||
@include mq(md) {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main {
|
||||
margin: auto;
|
||||
|
||||
@include mq(md) {
|
||||
position: relative;
|
||||
max-width: $content-width;
|
||||
margin-left: $nav-width-md;
|
||||
}
|
||||
|
||||
@include mq(lg) {
|
||||
// stylelint-disable function-name-case
|
||||
// disable for Max(), we want to use the CSS max() function
|
||||
margin-left: Max(
|
||||
#{$nav-width},
|
||||
calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width})
|
||||
);
|
||||
// stylelint-enable function-name-case
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,23 +78,12 @@
|
||||
|
||||
.main-header {
|
||||
z-index: 0;
|
||||
display: none;
|
||||
background-color: $sidebar-color;
|
||||
border-bottom: $border $border-color;
|
||||
|
||||
@include mq(md) {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: $header-height;
|
||||
background-color: $body-background-color;
|
||||
border-bottom: $border $border-color;
|
||||
}
|
||||
|
||||
&.nav-open {
|
||||
display: block;
|
||||
|
||||
@include mq(md) {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user