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

View file

@ -7,5 +7,4 @@ categories:
tags: tags:
draft: true draft: true
type: "post"
--- ---

View file

@ -7,7 +7,6 @@ categories:
tags: tags:
draft: true draft: true
type: "project"
status: status:
link: link:
--- ---

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";

View file

@ -1,3 +1,16 @@
// general
@import "variables";
@import "style";
// shortcodes
@import "shortcodes/verticalposts";
// partials
@import "partials/sidebar";
@import "partials/footer";
@import "partials/helpers/icons";
#introduction { #introduction {
background: var(--vriish-gradient); background: var(--vriish-gradient);
} }

View file

@ -1,14 +1,3 @@
// general
@import "variables";
@import "shortcodes";
// partials
@import "partials/sidebar";
@import "partials/footer";
// pages
@import "home";
* { * {
box-sizing: border-box; box-sizing: border-box;
scrollbar-color: var(--vriish-rose) var(--background); scrollbar-color: var(--vriish-rose) var(--background);

View file

@ -1,2 +0,0 @@
@import "verticalposts";
@import "icons";

View file

@ -6,7 +6,6 @@ categories:
tags: tags:
draft: false draft: false
type: "post"
description: "" description: ""
slug: "dunkler-modus-von-firefox" slug: "dunkler-modus-von-firefox"
--- ---

View file

@ -6,7 +6,6 @@ categories:
tags: tags:
draft: false draft: false
type: "post"
description: "" description: ""
slug: "firefox-dark-mode" slug: "firefox-dark-mode"
--- ---

View file

@ -10,7 +10,6 @@ tags:
- natenom - natenom
draft: false draft: false
type: "post"
description: "I did make a new iteration of this graphic for Natenoms Blog." description: "I did make a new iteration of this graphic for Natenoms Blog."
--- ---

View file

@ -6,7 +6,6 @@ categories:
tags: tags:
draft: false draft: false
type: "post"
description: "" description: ""
--- ---

View file

@ -9,7 +9,6 @@ tags:
- code - code
draft: false draft: false
type: "post"
description: "I'm working on my gitea theme and just added a $nojavascript alternative for two icons with pure css. :)" description: "I'm working on my gitea theme and just added a $nojavascript alternative for two icons with pure css. :)"
--- ---

View file

@ -10,7 +10,6 @@ tags:
- webdesign - webdesign
draft: false draft: false
type: "post"
description: "My also new gitea theme appears to be usable, as long as you're not logged in." description: "My also new gitea theme appears to be usable, as long as you're not logged in."
--- ---

View file

@ -8,7 +8,6 @@ tags:
- opensource - opensource
draft: false draft: false
type: "post"
description: "In the past I always preferred to make every bit myself (and disliked generators)." description: "In the past I always preferred to make every bit myself (and disliked generators)."
--- ---

View file

@ -2,8 +2,7 @@
<html lang="{{ .Page.Lang }}"> <html lang="{{ .Page.Lang }}">
<head> <head>
<title>{{ with .Title }} {{ . }} {{ end }}{{ .Site.Title }}</title> <title>{{ with .Title }} {{ . }} {{ end }}{{ .Site.Title }}</title>
{{- $style := resources.Get "/style.scss" | resources.ToCSS (dict "outputStyle" "compressed") }} {{ block "stylesheet" . }}{{ end }}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
<link href="/gpg.pub" rel="pgpkey authn" /> <link href="/gpg.pub" rel="pgpkey authn" />
<link href="https://social.anoxinon.de/@vri" rel="me" /> <link href="https://social.anoxinon.de/@vri" rel="me" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

View file

@ -1,5 +1,5 @@
{{- define "stylesheet" -}} {{- define "stylesheet" -}}
{{- $scss := resources.Get "/_default/list.scss" -}} {{- $scss := resources.Get "/scss/style.scss" -}}
{{- $style := $scss | resources.ToCSS -}} {{- $style := $scss | resources.ToCSS -}}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" /> <link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{- end -}} {{- end -}}

17
layouts/blog/list.html Normal file
View file

@ -0,0 +1,17 @@
{{- define "stylesheet" -}}
{{- $scss := resources.Get "/scss/blog.scss" -}}
{{- $style := $scss | resources.ToCSS -}}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{- end -}}
{{- define "main" }}
<main>
<h1 class="title">{{ .Title }}</h1>
<p>{{ .Content }}</p>
{{- range .Pages }}
<p> <a href="{{ .Permalink }}">{{ .Title }}</a> <span>{{ .Date.Day }}. {{ if eq .Params.lang "de"}} {{ index $.Site.Data.monate (printf "%d" .Date.Month) }} {{ else }} {{ .Date.Month }} {{ end }} {{ .Date.Year }}</span> </p>
{{- end }}
</main>
{{- end }}

32
layouts/blog/single.html Normal file
View file

@ -0,0 +1,32 @@
{{- define "stylesheet" -}}
{{- $scss := resources.Get "/scss/blog.scss" -}}
{{- $style := $scss | resources.ToCSS -}}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{- end -}}
{{- define "main" }}
<main>
{{- if eq .Params.type "post" }}
<p class="date-published" title="{{ .Date | time.Format "2. January 2006, 15:04 MST" }}">{{ .Date | time.Format "2. January 2006" }}</p>
{{- end }}
<h1 class="title">{{ .Title }}</h1>
{{ .Content -}}
<aside>
{{- with .Params.topics }}
<ul class="topics">
{{- range . }}
<li>
<a href="{{ "topics" | relURL}}/{{ . | urlize }}">{{ . }}</a>
</li>
{{ end }}
</ul>
{{- end }}
{{- with .Params.tags }}
tags
{{- range . }}
<a href='{{ "tags" | relURL }}/{{ . | urlize }}'>{{ . }}</a>
{{- end }}
{{- end }}
</aside>
</main>
{{- end }}

View file

@ -1,3 +1,9 @@
{{- define "stylesheet" -}}
{{- $scss := resources.Get "/scss/home.scss" -}}
{{- $style := $scss | resources.ToCSS -}}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{- end -}}
{{- define "header" }} {{- define "header" }}
<header id="introduction" class="global-header"> <header id="introduction" class="global-header">
<h1>{{ i18n "introduction-heading" }}</h1> <h1>{{ i18n "introduction-heading" }}</h1>