Refactor scss to minimize resulting css

This commit is contained in:
Vri 🌈 2023-01-15 00:19:35 +01:00
parent 8d154d444e
commit 190c0acf7f
Signed by: vrifox
GPG key ID: D40098E5B60B2197
23 changed files with 78 additions and 25 deletions

8
assets/scss/blog.scss Normal file
View file

@ -0,0 +1,8 @@
// general
@import "variables";
@import "style";
// partials
@import "partials/sidebar";
@import "partials/footer";
@import "partials/helpers/icons.scss";

38
assets/scss/home.scss Normal file
View file

@ -0,0 +1,38 @@
// general
@import "variables";
@import "style";
// shortcodes
@import "shortcodes/verticalposts";
// partials
@import "partials/sidebar";
@import "partials/footer";
@import "partials/helpers/icons";
#introduction {
background: var(--vriish-gradient);
}
section {
position: relative;
h2 {
.more{
font-size: .75em;
font-weight: normal;
hyphens: none;
&::after {
content: "\27F6";
margin-left: .25em;
transition: margin .5s;
}
&:hover::after {
margin-left: .5em !important;
}
}
&:hover .more::after {
margin-left: .35em;
}
}
}

View file

@ -0,0 +1,25 @@
footer {
color: var(--text-secondary);
grid-area: footer;
margin: 1em auto;
text-align: center;
p{
margin: .25em;
span {
&:not(:last-child) {
&::after {
content: '·';
padding: .25em;
}
}
a {
color: var(--text-secondary);
text-decoration-color: transparent;
&:hover {
text-decoration: underline;
text-decoration-color: var(--text-secondary);
}
}
}
}
}

View file

@ -0,0 +1,5 @@
.icon {
width: 1.25rem;
height: 1.25rem;
fill: currentColor;
}

View file

@ -0,0 +1,169 @@
// -----------
// - sidebar -
// -----------
#sidebar {
background: var(--sidebar-background);
border-top: 2px solid var(--vriish-rose);
display: flex;
flex-direction: column;
grid-area: sidebar;
margin-top: -2px;
position: sticky;
top: 0;
z-index: 1;
gap: 1em;
padding: 1em;
@media (min-width: 921px) {
bottom: 0;
height: 100%;
}
header {
text-align: center;
user-select: none;
#avatar {
border-radius: 500% 300% / 300% 500%;
width: calc(100% - 2em);
max-width: 200px;
transition: .4s border-radius ease-in-out;
&:hover {
border-radius: 300% 500% / 500% 300%;
}
}
#name {
margin: 0;
font-weight: bold;
font-size: 1.8em;
}
#information {
margin: 0;
font-size: .8em;
#social-links {
list-style: none;
margin: 0;
padding: 0;
img {
height: 2em;
fill: var(--vriish-rose);
}
}
}
}
#sidebar-menu {
user-select: none;
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
border-radius: .5em;
margin: .5em 0;
position: relative;
letter-spacing: .025em;
a {
display: block;
padding: .25em .5em;
}
::after {
background: var(--vriish-gradient);
border-radius: .5em;
bottom: 0;
content: "";
left: 0;
position: absolute;
right: 100%;
top: 0;
transition: opacity .5s, width .5s;
opacity: 0;
width: 0;
z-index: -1;
}
&.active {
background: var(--vriish-gradient);
}
&:hover {
::after {
opacity: 1;
right: 0;
width: 100%;
}
}
}
a {
text-decoration: none;
}
}
aside {
bottom: 1em;
position: absolute;
left: 1em;
right: 1em;
@media (max-width: 920px) {
position: initial;
}
#language-select {
position: relative;
pointer-events: none;
&:hover {
#languages {
//display: block;
bottom: 2em;
opacity: 100%;
pointer-events: all;
* {
pointer-events: all;
}
}
}
#language-icon {
text-decoration: none;
padding-top: 1em;
pointer-events: all;
&::after {
content: attr(data-page-lang);
position: absolute;
left: -4px;
font-size: 0.6em;
line-height: 1.5em;
bottom: 0;
text-transform: uppercase;
}
}
#languages {
background-color: var(--background);
border-radius: .5em;
margin: 0;
padding: 0;
user-select: none;
position: absolute;
//display: none;
bottom: 1em;
opacity: 0%;
transition: bottom .5s, opacity .5s;
li {
list-style: none;
overflow: hidden;
padding: .25em .5em;
position: relative;
transition: background .5s;
border-radius: .5em;
margin: .2em;
&:not(:last-of-type) {
margin-bottom: .5em;
}
&.active {
background: var(--vriish-gradient);
}
&:hover {
background: var(--vriish-gradient);
}
a {
text-decoration: none;
display: block;
}
}
}
}
}
}

View file

@ -0,0 +1,31 @@
.verticalposts {
hyphens: auto;
margin-top: 4em;
.verticalposts-wrapper {
border-radius: .5em;
display: flex;
flex-direction: row;
gap: 1em;
overflow-x: scroll;
scroll-snap-type: x proximity;
.post-group {
background: var(--vriish-gradient);
border-radius: .5em;
display: flex;
flex-direction: column;
scroll-snap-align: start;
min-width: 15em;
width: 33.333%;
.title {
flex: auto;
margin: 1em;
}
aside {
margin: 1em;
}
}
}
a {
text-decoration: none;
}
}

148
assets/scss/style.scss Normal file
View file

@ -0,0 +1,148 @@
* {
box-sizing: border-box;
scrollbar-color: var(--vriish-rose) var(--background);
scrollbar-width: thin;
&::-webkit-scrollbar {
background: var(--background);
width: 6px;
}
&::-webkit-scrollbar-thumb { background: var(--vriish-rose); }
}
html {
margin: 0;
overflow-x: hidden;
overflow-y: scroll;
padding: 0;
body {
background: var(--background);
color: var(--text);
display: grid;
font-family: system-ui, sans-serif;
font-size: 1.2em;
grid-template-areas:
"header header"
"sidebar content"
"sidebar footer";
grid-template-columns: 250px 1fr;
grid-template-rows: min-content;
line-height: 1.7;
margin: 0;
min-height: 100vh;
@media (max-width: 920px) {
font-size: 1em;
grid-template-areas:
"header"
"content"
"sidebar"
"footer";
grid-template-columns: 1fr;
}
h1, h2, h3, h4, h5, h6 {
line-height: 1em;
margin: .8em 0;
}
a {
color: var(--text);
text-decoration: underline;
text-decoration-color: var(--vriish-rose);
text-underline-offset: 3px;
transition: text-decoration-color .2s;
&:hover { text-decoration-color: var(--text); }
}
pre {
border: 1px solid var(--vriish-rose);
border-radius: 4px;
overflow: auto;
padding: 10px 15px;
}
p {
hyphens: auto;
img {
border-radius: 1rem;
display: block;
margin: 0 auto;
}
}
hr {
border: 1px solid var(--border);
color: var(--border);
margin: 60px 0;
}
}
}
.global-header {
align-items: center;
grid-area: header;
position: relative;
display: flex;
flex-direction: column;
gap: .5em;
justify-content: center;
padding: 3em 0;
z-index: 2;
h1, p {
margin: 0;
}
}
// ------------------------
// - header / nav; footer -
// ------------------------
/*header, footer {
align-items: center;
display: flex;
overflow: auto;
white-space: nowrap;
width: 100%;
a {
padding: 17.6px 15px;
text-decoration-color: var(--background);
text-decoration-thickness: 2px !important;
text-underline-offset: 6px;
margin: 0 15px;
&:hover { text-decoration-color: var(--vriish-rose); }
}
}
header {
a {
color: var(--text-2);
}
h1 {
display: flex;
font-size: 1em;
margin: 0;
a {
color: var(--vriish-rose);
}
}
nav {
display: flex;
margin-left: auto;
}
aside {
margin-left: auto;
}
}*/
// --------
// - main -
// --------
main {
grid-area: content;
margin: 20px auto;
max-width: 1000px;
overflow: hidden;
padding: 30px;
width: 100%;
span { font-size: .8em; }
}
p.date-published {
margin-bottom: -1.5em;
font-size: smaller;
font-style: italic;
}

View file

@ -0,0 +1,32 @@
:root {
--background: hsl(210, 21%, 15%);
--border: hsl(210, 21%, 20%);
--text: hsl(210, 21%, 95%);
--text-2: hsl(210, 21%, 80%);
--text-secondary: hsl(210, 21%, 40%);
--sidebar-background: hsl(210, 21%, 10%);
--vriish-rose: hsl(0, 100%, 75%);
--orange: hsl(25, 100%, 75%);
--gold: hsl(50, 100%, 75%);
--emerald: hsl(130, 100%, 75%);
--sky: hsl(215, 100%, 75%);
--purpur: hsl(275, 100%, 75%);
--white: hsl(360, 100%, 100%);
--vriish-gradient: linear-gradient(30deg, var(--orange) -100%, var(--vriish-rose) 100%);
--vriish-gradient-shadow: 2px 2px 10px var(--background);
}
@media (prefers-color-scheme: light) {
:root {
--background: hsl(0, 100%, 97.5%);
--border: hsl(0, 100%, 90%);
--text: hsl(0, 100%, 5%);
--text-2: hsl(0, 100%, 10%);
--sidebar-background: hsl(0, 100%, 95%);
}
}