Feat: remove nav and toctree in small screen

This commit is contained in:
Bertrand Benjamin 2022-08-31 05:58:33 +02:00
parent b6b089542e
commit 1764489028
2 changed files with 412 additions and 420 deletions

View File

@ -1,8 +1,8 @@
@import "variables.less"; @import "variables.less";
html, body { html, body {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
h1, h1,
@ -11,68 +11,68 @@ h3,
h4, h4,
h5, h5,
h6 { h6 {
font-weight: 300; font-weight: 300;
line-height: 1.1; line-height: 1.1;
} }
h1{ h1{
font-size: 2.4em font-size: 2.4em
} }
h2 { h2 {
font-size: 2em; font-size: 2em;
background-color: @light-grey; background-color: @light-grey;
padding: 4px; padding: 4px;
} }
h3 { h3 {
font-size: 1.6em font-size: 1.6em
} }
h4 { h4 {
font-size: 1.36em font-size: 1.36em
} }
h5 { h5 {
font-size: 1.2em font-size: 1.2em
} }
h6 { h6 {
font-size: 1.1em font-size: 1.1em
} }
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
background-color: @body-bg; background-color: @body-bg;
color: @text-color; color: @text-color;
font-family: @sans; font-family: @sans;
font-size: 1.02em; font-size: 1.02em;
line-height: 1.2em; line-height: 1.2em;
} }
a { a {
color: @link-color; color: @link-color;
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
color: @link-hover-color; color: @link-hover-color;
} }
hr { hr {
color: @light-grey; color: @light-grey;
background-color: @light-grey; background-color: @light-grey;
height: 1px; height: 1px;
border: none; border: none;
margin-top: 40px; margin-top: 40px;
margin-bottom: 40px; margin-bottom: 40px;
} }
img { img {
max-width: 100%; max-width: 100%;
border: 2px solid @med-light-grey; border: 2px solid @med-light-grey;
box-shadow: 0px 0px 10px @light-grey; box-shadow: 0px 0px 10px @light-grey;
} }
.button { .button {
@ -84,23 +84,23 @@ img {
display: inline-flex; display: inline-flex;
vertical-align: top; vertical-align: top;
padding: 5px 15px; padding: 5px 15px;
* { * {
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
gap: 10px; gap: 10px;
} }
a { a {
width:100%; width:100%;
height:100%; height:100%;
} }
.nolink { .nolink {
width:100%; width:100%;
height:100%; height:100%;
} }
h3 { h3 {
margin: 0px; margin: 0px;
} }
} }
@ -109,289 +109,163 @@ img {
} }
aside { aside {
background-color: @sidebar-bg; background-color: @sidebar-bg;
color: @sidebar-text-color; color: @sidebar-text-color;
// text-align: center; // text-align: center;
a { a {
color: @sidebar-link-color; color: @sidebar-link-color;
display: block; display: block;
}
a:hover {
color: @sidebar-link-hover-color;
}
.title {
text-align: center;
margin-bottom: 50px;
margin-top: 50px;
img {
padding: 20px;
border-radius: 50%;
max-width: 140px;
} }
h1 { a:hover {
margin: 15px 0 5px 0; color: @sidebar-link-hover-color;
} }
p { .title {
margin: 0 0 15px 0; text-align: center;
font-size: .92em; padding-bottom: 20px;
padding-top: 20px;
img {
padding: 20px;
border-radius: 50%;
max-width: 140px;
}
h1 {
margin: 15px 0 5px 0;
}
p {
margin: 0 0 15px 0;
font-size: .92em;
}
}
nav {
display: none;
}
.tagcloud {
display: none;
} }
}
nav {
background-color: @navbar-bg;
h2 {
background-color: @navbar-bg;
margin-bottom: 0;
}
ul {
padding-inline-start: 0px;
display: block;
}
ul.toctree {
li {
a {
color: @navbar-text-color;
border: none;
}
}
li.toctree-l1 {
li.current{
background-color: @navbar-toctree-l2-sel-bg;
color: @navbar-toctree-l2-sel-txt;
padding: 10px;
border-left: solid 2px @orange;
}
}
li.current{
a {
background-color: @navbar-toctree-l1-sel-bg;
color: @navbar-toctree-l1-sel-txt;
border-top: solid 1px @light-grey;
border-bottom: solid 1px @light-grey;
border-left: solid 2px @orange;
}
a:hover {
color: @orange;
}
}
li.toctree-l2 {
a {
border: none;
background-color: @navbar-toctree-l2-bg;
color: @navbar-toctree-l2-txt;
}
}
a {
padding: 10px;
}
a:hover {
color: @orange;
}
}
ul.list {
li {
display: inline;
line-height: 1.6em;
font-size: 1.28em;
text-transform: lowercase;
}
}
}
.tagcloud {
h2 {
margin-bottom: 0;
background-color: @sidebar-bg;
}
ul {
list-style: none;
padding: 0;
margin: 10px;
}
ul li {
display: inline-block;
}
li.tag-0 {
font-size: 170%;
}
li.tag-1 {
font-size: 150%;
}
li.tag-2 {
font-size: 120%;
}
li.tag-3 {
font-size: 100%;
}
li.tag-4 {
font-size: 80%;
}
}
} }
main { main {
nav { nav {
text-align: center; display: none;
text-transform: uppercase;
font-size: .72em;
padding: 14px 0 14px 0;
border-bottom: @nav-border-color 1px solid;
}
nav, .translations {
a {
padding: 0 4px 0 4px;
border-left: @nav-border-color 1px solid;
border-right: @nav-border-color 1px solid;
} }
:first-child {
border-left: none;
}
:last-child { article {
border-right: none; margin: 0 8% 2% 8%;
}
}
.neighbors { header {
margin: 4% 0% 4% 0%; h1, h2 {
height: 20px; margin-bottom: 0;
} }
.pagination { p {
margin: 4% 8% 4% 8%; color: @header-text-color;
height: 20px; font-size: 0.86em;
} }
.social-share { .translations {
p { float: right;
font-size: .8em;
}
}
article { .active {
margin: 0 8% 2% 8%; font-weight: 600;
}
header { }
h1, h2 { }
margin-bottom: 0;
} code, kbd, samp, pre {
font-family: @mono;
p { }
color: @header-text-color;
font-size: 0.86em; blockquote, pre {
} background-color: rgba(128,128,128,0.05);
border-top-right-radius: 5px;
.translations { border-bottom-right-radius: 5px;
float: right; border-left: 8px solid rgba(128,128,128,0.075);
border-left-width: 10px;
.active { }
font-weight: 600;
blockquote {
padding: 10px 20px;
font-weight: 300;
font-size: 1.1em;
}
pre {
padding: 4px;
font-size: .9em;
overflow-x: auto;
}
samp {
white-space: pre;
display: block;
overflow-x: auto;
}
kbd {
padding: .1em .6em;
border: 1px solid rgba(63,63,63,0.25);
box-shadow: 0 1px 0 rgba(63,63,63,0.25);
background-color: #fff;
color: #333;
border-radius: 3px;
display: inline-block;
margin: 0 .1em;
white-space: nowrap;
font-size: .78em;
}
*:not(pre) > code {
font-size: .8em;
white-space: nowrap;
color: #c25;
padding: 1px 3px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
border-radius: 3px;
}
.comment-count {
font-size: .8em;
}
table {
border-collapse: collapse;
border-spacing: 0;
thead:first-child tr:first-child th {
border-top: 0;
}
th, td {
padding: 8px;
line-height: 20px;
vertical-align: top;
border-top: 1px solid #ddd;
}
} }
}
} }
code, kbd, samp, pre { footer {
font-family: @mono; padding-top: 4px;
border-top: @footer-border-color 1px solid;
p {
margin: 2px;
text-align: center;
padding: 0 40px 0 40px;
color: @footer-text-color;
font-size: 11px;
}
} }
blockquote, pre {
background-color: rgba(128,128,128,0.05);
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-left: 8px solid rgba(128,128,128,0.075);
border-left-width: 10px;
}
blockquote {
padding: 10px 20px;
font-weight: 300;
font-size: 1.1em;
}
pre {
padding: 4px;
font-size: .9em;
overflow-x: auto;
}
samp {
white-space: pre;
display: block;
overflow-x: auto;
}
kbd {
padding: .1em .6em;
border: 1px solid rgba(63,63,63,0.25);
box-shadow: 0 1px 0 rgba(63,63,63,0.25);
background-color: #fff;
color: #333;
border-radius: 3px;
display: inline-block;
margin: 0 .1em;
white-space: nowrap;
font-size: .78em;
}
*:not(pre) > code {
font-size: .8em;
white-space: nowrap;
color: #c25;
padding: 1px 3px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
border-radius: 3px;
}
.comment-count {
font-size: .8em;
}
table {
border-collapse: collapse;
border-spacing: 0;
thead:first-child tr:first-child th {
border-top: 0;
}
th, td {
padding: 8px;
line-height: 20px;
vertical-align: top;
border-top: 1px solid #ddd;
}
}
}
footer {
padding-top: 4px;
border-top: @footer-border-color 1px solid;
p {
margin: 2px;
text-align: center;
padding: 0 40px 0 40px;
color: @footer-text-color;
font-size: 11px;
}
}
} }
.about { .about {
@ -401,96 +275,96 @@ main {
} }
.tag-cloud { .tag-cloud {
text-align: center; text-align: center;
a { a {
background-color: @tag-bg; background-color: @tag-bg;
padding: .2em .6em .2em; padding: .2em .6em .2em;
font-size: .74em; font-size: .74em;
line-height: 1;
color: @tag-text-color;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
a:hover {
background-color: @tag-hover-color;
}
}
a.btn {
background-color: @btn-bg;
padding: .6em .6em;
font-size: .8em;
line-height: 1; line-height: 1;
color: @tag-text-color; color: @btn-text-color;
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
vertical-align: baseline; vertical-align: baseline;
border-radius: .25em; border-radius: .25em;
}
a:hover {
background-color: @tag-hover-color;
}
}
a.btn {
background-color: @btn-bg;
padding: .6em .6em;
font-size: .8em;
line-height: 1;
color: @btn-text-color;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
} }
a.btn:hover { a.btn:hover {
background-color: @btn-hover-color; background-color: @btn-hover-color;
} }
.center, .text-center { .center, .text-center {
text-align: center; text-align: center;
} }
.img-center { .img-center {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
display: block; display: block;
} }
.align-center { .align-center {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
display: block; display: block;
} }
.float-left { .float-left {
float: left; float: left;
} }
.float-right { .float-right {
float: right; float: right;
} }
div.related-posts { div.related-posts {
margin: 15px 0 15px 0; margin: 15px 0 15px 0;
padding-bottom: 20px; padding-bottom: 20px;
border-top: @rel-post-border-color 1px solid; border-top: @rel-post-border-color 1px solid;
border-bottom: @rel-post-border-color 1px solid; border-bottom: @rel-post-border-color 1px solid;
h4 { h4 {
margin: 20px 0 25px 0; margin: 20px 0 25px 0;
} }
ul { ul {
font-size: 1.1em; font-size: 1.1em;
padding-left: 12px; padding-left: 12px;
li { li {
padding: 4px 0 4px 0; padding: 4px 0 4px 0;
}
} }
}
} }
ul.list, ul.social, ul.related-posts { ul.list, ul.social, ul.related-posts {
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
ul.list { ul.list {
padding: 1em 0 1em 0; padding: 1em 0 1em 0;
li { li {
padding: 4px; padding: 4px;
} }
} }
ul.breadcrumb { ul.breadcrumb {
@ -520,28 +394,28 @@ ul.breadcrumb {
} }
ul.social { ul.social {
font-size: 1.6em; font-size: 1.6em;
padding-top: 20px; padding-top: 20px;
li { li {
display: inline; display: inline;
} }
a:hover { a:hover {
z-index: 2; z-index: 2;
-webkit-transform: translateY(-5px); -webkit-transform: translateY(-5px);
transform: translateY(-5px); transform: translateY(-5px);
} }
a { a {
display: inline-block; display: inline-block;
width: 36px; width: 36px;
height: 36px; height: 36px;
border-radius: 100%; border-radius: 100%;
text-align: center; text-align: center;
font-size: .8em; font-size: .8em;
line-height: 36px; line-height: 36px;
} }
} }
@ -552,49 +426,167 @@ ul.social {
// //
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
aside { aside {
width: 20%; width: 20%;
max-width: 250px; max-width: 250px;
height: 100%; height: 100%;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
overflow-y: auto; overflow-y: auto;
div { .title {
nav { padding-bottom: 50px;
ul { padding-top: 50px;
li { }
padding: 0; nav {
display: block; display: block;
} background-color: @navbar-bg;
h2 {
background-color: @navbar-bg;
margin-bottom: 0;
}
ul {
padding-inline-start: 0px;
display: block;
li {
padding: 0;
display: block;
}
}
ul.toctree {
li {
a {
color: @navbar-text-color;
border: none;
}
}
li.toctree-l1 {
li.current{
background-color: @navbar-toctree-l2-sel-bg;
color: @navbar-toctree-l2-sel-txt;
padding: 10px;
border-left: solid 2px @orange;
}
}
li.current{
a {
background-color: @navbar-toctree-l1-sel-bg;
color: @navbar-toctree-l1-sel-txt;
border-top: solid 1px @light-grey;
border-bottom: solid 1px @light-grey;
border-left: solid 2px @orange;
}
a:hover {
color: @orange;
}
}
li.toctree-l2 {
a {
border: none;
background-color: @navbar-toctree-l2-bg;
color: @navbar-toctree-l2-txt;
}
}
a {
padding: 10px;
}
a:hover {
color: @orange;
}
}
ul.list {
li {
display: inline;
line-height: 1.6em;
font-size: 1.28em;
text-transform: lowercase;
}
}
} }
}
ul.social { .tagcloud {
padding-top: 32px; display: block;
} h2 {
} margin-bottom: 0;
} background-color: @sidebar-bg;
}
main { ul {
width: 75%; list-style: none;
height: 100%; padding: 0;
position: absolute; margin: 10px;
top: 0; }
right: 2.5%;
article { ul li {
display: inline-block;
}
&.single { li.tag-0 {
min-height: 80%; font-size: 170%;
} }
ul.list { li.tag-1 {
li { font-size: 150%;
padding: 2px; }
li.tag-2 {
font-size: 120%;
}
li.tag-3 {
font-size: 100%;
}
li.tag-4 {
font-size: 80%;
}
}
}
main {
width: 75%;
height: 100%;
position: absolute;
top: 0;
right: 2.5%;
nav {
display: block;
text-align: center;
text-transform: uppercase;
font-size: .72em;
padding: 14px 0 14px 0;
border-bottom: @nav-border-color 1px solid;
}
nav, .translations {
a {
padding: 0 4px 0 4px;
border-left: @nav-border-color 1px solid;
border-right: @nav-border-color 1px solid;
}
:first-child {
border-left: none;
}
:last-child {
border-right: none;
}
}
article {
&.single {
min-height: 80%;
}
ul.list {
li {
padding: 2px;
}
}
} }
}
} }
}
} }

File diff suppressed because one or more lines are too long