Split scss into multiple files

This commit is contained in:
ItsDrike 2022-05-15 00:16:35 +02:00
parent 7f84716ce8
commit 5c076900b9
No known key found for this signature in database
GPG key ID: B014E761034AF742
8 changed files with 268 additions and 279 deletions

View file

@ -0,0 +1,7 @@
// Preceeding clickable anchors in headers
// (for exact header reference)
h1, h2, h3, h4, h5, h6 {
.anchor {
font-weight: lighter;
}
}

View file

@ -0,0 +1,30 @@
.highlight {
position: relative;
}
.copy-button {
position: absolute;
bottom: 7px;
right: 7px;
border: 0;
border-radius: 4px;
padding: 1px;
font-size: 0.7em;
line-height: 1.8;
color: #fff;
background-color: #666;
min-width: 55px;
text-align: center;
}
.copy-button:hover {
background-color: #777;
}
.highlight .copy-button {
display: none;
}
.highlight:hover .copy-button {
display: inline;
}

View file

@ -0,0 +1,14 @@
footer {
background-color: $black;
width: 100%;
height: $footer-height;
color: lighten($black, 50);
a {
color: inherit;
&:hover {
color: lighten($black, 75);
}
}
}

View file

@ -0,0 +1,64 @@
// This is for list type pages, such as posts page
// to show individual items/pages for that listing
.item-list {
width: 100 1%;
max-width: 1500px;
text-align: left;
padding: 20px;
margin: 20px auto;
.item-list-group {
display: flex;
margin-bottom: 1.9em;
line-height: normal;
}
.item-list-year {
padding-top: 6px;
margin-right: 0.8em;
font-size: 2em;
border-right: 2px solid rgba(255, 255, 255, 0.4);
padding-right: 0.8em;
a {
color: $primary-light;
}
}
.item-list-items {
flex-grow: 1;
margin: 0;
padding: 0;
list-style: none;
}
.item-list-item {
border-bottom: 1px grey dashed;
.item-name {
display: flex;
justify-content: space-between;
align-items: baseline;
text-decoration: none;
}
.item-title {
font-size: 1.3rem;
margin: 5px 0 5px 0;
}
.item-day {
flex-shrink: 0;
margin-left: 1em;
opacity: 0.8;
}
.item-details {
font-size: 0.8rem;
text-indent: 2em;
}
.item-summary {
font-size: 1rem;
}
}
}

105
static/src/scss/_main.scss Normal file
View file

@ -0,0 +1,105 @@
html, body {
color: $body-color;
}
#main {
margin-top: $spacer * 5;
// screen height - top padding - navbar height - footer margin
min-height: calc(100vh - #{$spacer * 5} - #{$navbar-height} - #{$spacer * 3});
}
.short-top {
margin-top: $spacer !important;
}
a {
color: $primary;
&:link {
text-decoration: none;
}
&:hover {
text-decoration: underline;
transition: color 0.5s;
color: $body-color;
}
&.colour-invert {
color: $body-color;
&:hover {
color: $primary;
}
}
&.no-color-change {
&, &:hover {
text-decoration: none;
color: inherit;
}
}
}
ul ul, ol ol {
padding-left: $spacer * 1.5;
}
.content-detail {
text-indent: 2em;
}
table td {
vertical-align: middle;
}
.table-dark {
color: $body-color;
}
.content {
h1, h2, h3, h4, h5, h6 {
margin-top: $headings-margin-bottom * 2.2;
}
img {
width: 100%;
}
iframe {
width: 100%;
&:not([height]) {
height: 75vh;
}
&.youtube-embed {
margin-bottom: $paragraph-margin-bottom;
height: 50vh;
}
}
blockquote {
border-left: $spacer * 0.2 solid $light;
padding-left: $spacer * 1.2;
}
table {
@extend .table, .table-dark, .table-striped;
margin: 0 auto;
margin-bottom: $paragraph-margin-bottom;
width: 66%;
text-align: center;
}
}
img {
object-fit: cover;
}
.header-image {
width: 100%;
height: 35vh;
}

View file

@ -0,0 +1,20 @@
.navbar {
background-color: $black;
padding-top: 0;
padding-bottom: 0;
.navbar-brand {
font-size: $font-size-base;
}
.nav-link {
padding-right: $font-size-base !important;
padding-left: $font-size-base !important;
}
.nav-link code, .navbar-brand code {
background-color: inherit;
font-size: 90%;
}
}

View file

@ -0,0 +1,21 @@
#TableOfContents {
font-size: $font-size-base;
ul {
list-style-type: none;
}
& > ul {
margin-bottom: 0;
padding-left: $spacer;
li {
text-indent: -5px;
&::before {
margin-right: 5px;
content: "-";
}
}
}
}

View file

@ -14,282 +14,10 @@ $paragraph-margin-bottom: $headings-margin-bottom * 0.85;
$navbar-height: 40px;
$body-color: $gray-300;
html, body {
color: $body-color;
}
.navbar {
background-color: $black;
padding-top: 0;
padding-bottom: 0;
.navbar-brand {
font-size: $font-size-base;
}
.nav-link {
padding-right: $font-size-base !important;
padding-left: $font-size-base !important;
}
.nav-link code, .navbar-brand code {
background-color: inherit;
font-size: 90%;
}
}
footer {
background-color: $black;
width: 100%;
height: $footer-height;
color: lighten($black, 50);
a {
color: inherit;
&:hover {
color: lighten($black, 75);
}
}
}
#TableOfContents {
font-size: $font-size-base;
ul {
list-style-type: none;
}
& > ul {
margin-bottom: 0;
padding-left: $spacer;
li {
text-indent: -5px;
&::before {
margin-right: 5px;
content: "-";
}
}
}
}
#main {
margin-top: $spacer * 5;
// screen height - top padding - navbar height - footer margin
min-height: calc(100vh - #{$spacer * 5} - #{$navbar-height} - #{$spacer * 3});
}
.short-top {
margin-top: $spacer !important;
}
a {
color: $primary;
&:link {
text-decoration: none;
}
&:hover {
text-decoration: underline;
transition: color 0.5s;
color: $body-color;
}
&.colour-invert {
color: $body-color;
&:hover {
color: $primary;
}
}
&.no-color-change {
&, &:hover {
text-decoration: none;
color: inherit;
}
}
}
pre.chroma {
margin-bottom: $paragraph-margin-bottom;
padding: $spacer;
.highlight & {
margin-top: 0;
}
}
p, li, h1, h2, h3, h4, h5, h6 {
code {
@extend .chroma;
padding: $spacer * 0.25;
color: inherit;
}
}
ul ul, ol ol {
padding-left: $spacer * 1.5;
}
.content-detail {
text-indent: 2em;
}
table td {
vertical-align: middle;
}
.table-dark {
color: $body-color;
}
.content {
h1, h2, h3, h4, h5, h6 {
margin-top: $headings-margin-bottom * 2.2;
}
img {
width: 100%;
}
iframe {
width: 100%;
&:not([height]) {
height: 75vh;
}
&.youtube-embed {
margin-bottom: $paragraph-margin-bottom;
height: 50vh;
}
}
blockquote {
border-left: $spacer * 0.2 solid $light;
padding-left: $spacer * 1.2;
}
table {
@extend .table, .table-dark, .table-striped;
margin: 0 auto;
margin-bottom: $paragraph-margin-bottom;
width: 66%;
text-align: center;
}
}
h1, h2, h3, h4, h5, h6 {
.anchor {
font-weight: lighter;
}
}
img {
object-fit: cover;
}
.header-image {
width: 100%;
height: 35vh;
}
.item-list {
width: 100%;
max-width: 1500px;
text-align: left;
padding: 20px;
margin: 20px auto;
.item-list-group {
display: flex;
margin-bottom: 1.9em;
line-height: normal;
}
.item-list-year {
padding-top: 6px;
margin-right: 0.8em;
font-size: 2em;
border-right: 2px solid rgba(255, 255, 255, 0.4);
padding-right: 0.8em;
a {
color: $primary-light;
}
}
.item-list-items {
flex-grow: 1;
margin: 0;
padding: 0;
list-style: none;
}
.item-list-item {
border-bottom: 1px grey dashed;
.item-name {
display: flex;
justify-content: space-between;
align-items: baseline;
text-decoration: none;
}
.item-title {
font-size: 1.3rem;
margin: 5px 0 5px 0;
}
.item-day {
flex-shrink: 0;
margin-left: 1em;
opacity: 0.8;
}
.item-details {
font-size: 0.8rem;
text-indent: 2em;
}
.item-summary {
font-size: 1rem;
}
}
}
.highlight {
position: relative;
}
.copy-button {
position: absolute;
bottom: 7px;
right: 7px;
border: 0;
border-radius: 4px;
padding: 1px;
font-size: 0.7em;
line-height: 1.8;
color: #fff;
background-color: #666;
min-width: 55px;
text-align: center;
}
.copy-button:hover {
background-color: #777;
}
.highlight .copy-button {
display: none;
}
.highlight:hover .copy-button {
display: inline;
}
@import "main";
@import "navbar";
@import "footer";
@import "items";
@import "table_of_contents";
@import "anchors";
@import "code_copy";