From 821563f93a58d0879877f88b372522d01974847d Mon Sep 17 00:00:00 2001 From: Yuliya Bagriy Date: Sun, 7 Jan 2024 22:51:16 -0500 Subject: [PATCH] use tailwindcss prose --- assets/css/main.css | 7 +- assets/css/site.css | 167 ------ layouts/_default/_markup/render-heading.html | 11 +- layouts/_default/_markup/render-image.html | 8 +- layouts/_default/_markup/render-link.html | 4 +- layouts/_default/archive.html | 2 +- layouts/_default/baseof.html | 6 +- layouts/articles/single.html | 20 +- layouts/index.html | 4 +- layouts/partials/article-list.html | 6 +- layouts/partials/article.html | 4 +- layouts/partials/footer.html | 2 +- layouts/partials/header.html | 13 +- layouts/partials/internal-link-classes.html | 1 + layouts/partials/title.html | 4 +- layouts/shortcodes/callout.html | 13 +- layouts/shortcodes/kbd.html | 2 +- package-lock.json | 531 ++++++++++++++++--- package.json | 1 + tailwind.config.js | 259 ++++++++- 20 files changed, 730 insertions(+), 335 deletions(-) delete mode 100644 assets/css/site.css create mode 100644 layouts/partials/internal-link-classes.html diff --git a/assets/css/main.css b/assets/css/main.css index 6a9b04e1..1edda9c4 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -4,8 +4,7 @@ @import './fonts.css'; -html { - font-size: 62.5%; -} -@import './site.css'; +h1, h2, h3, h4, h5, h6, p { + text-rendering: optimizeLegibility; +} diff --git a/assets/css/site.css b/assets/css/site.css deleted file mode 100644 index 05db8959..00000000 --- a/assets/css/site.css +++ /dev/null @@ -1,167 +0,0 @@ -h1, h2, h3, h4, h5, h6, strong { - @apply font-bold; - } - -h1, h2, h3, h4, h5, h6, p { - text-rendering: optimizeLegibility; -} - -article > p { - @apply text-[1.8rem] leading-[3.2rem] my-[2.4rem]; -} - -article em { - @apply text-blue-500 font-serif italic font-bold tracking-tight; -} - -article a { - @apply cursor-pointer; -} - -article hr { - @apply h-px my-[5.6rem] border-0; - background: radial-gradient(circle, theme(colors.blue.500) 0%, theme(colors.blue.400) 50%, theme(colors.amber.300), white); -} - - -article p > code, article li > code, article td > code { - @apply text-[0.8em] font-mono inline-block bg-slate-200 py-[0.2rem] px-[0.6rem] my-[0.1rem] mx-0 rounded-[0.3rem]; -} - -a code, h1 code, h2 code, h3 code, h4 code, article th > code { - @apply text-[0.9em] font-mono; - - &::after, &::before { - @apply content-['`']; - } -} - -article .gist { - @apply w-full my-[2.4rem] mx-0; -} - -article .gist .gist-file { - @apply mb-0; -} - -article .highlight { - @apply w-full my-[2.4rem] mx-0 p-bleed overflow-auto rounded-[0.6rem] bg-[#282a36]; -} - -article .highlight code { - @apply text-[0.8em] font-mono; -} - - - -article blockquote { - @apply w-full my-[2.4rem] mx-0 p-bleed bg-slate-200 rounded-l-[0.3rem] rounded-r-[0.6rem] border-l-[0.3rem] border-slate-500; -} - -article blockquote p, article blockquote { - @apply text-[1.7rem]; -} - -article blockquote p { - @apply mb-[1.6rem]; -} - - -article blockquote > :last-child { - @apply !mb-0; -} - -@screen normal { - article .highlight, article blockquote, article .gist { - @apply w-[80.5rem] my-[2.4rem] mx-bleed-negative; - } -} - -article li { - @apply relative mb-[1.2rem]; -} - -article ol { - @apply my-[2.4rem]; - counter-reset: counts 0; -} - -article ul { - @apply my-[2.4rem]; -} - - -article ol > li { - @apply table; -} - -article ul > li { - @apply pl-[2.4rem]; -} - - -article ol > li:before { - @apply text-blue-500 font-bold table-cell pr-6; - counter-increment: counts; - content: counter(counts)'. '; -} - - -article ol ol > li:before { - content: counters(counts, '.') '.'; -} - -article li ol li:last-child, article li ol, article li ul li:last-child, article li ul { - @apply m-0; -} - - -article ul > li:before { - @apply content-['→'] text-blue-500 font-bold absolute top-0 left-0; -} - -article ul ul, article ul ol, article ol ul, article ol ol { - @apply mt-[1.2rem]; -} - - -h2 { - @apply text-[3rem] leading-[4rem] mt-[5.6rem] mb-[3.2rem]; -} - - -h3 { - @apply text-[2.4rem] leading-[3.6rem] mt-16 mb-[1.6rem]; -} - - -h4 { - @apply text-[1.8rem] leading-[2.8rem] mb-[0.8rem]; -} - -article h2 + *, article h3 + *, article h4 + *, article hr + * { - @apply mb-0; -} - -article table:not([class]) { - @apply text-[1.6rem] leading-[1.5em] w-full; -} - -article table:not([class]) thead { - @apply font-bold bg-amber-300; -} - -article table:not([class]) thead th { - @apply align-bottom p-[0.75em]; -} - -article table:not([class]) tbody tr { - @apply border border-solid border-amber-300; -} - -article table:not([class]) tbody td { - @apply align-top p-3; -} - - - diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 151798d2..87e10f52 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,5 +1,6 @@ -{{/*
{{ .Text | safeHTML }}
*/}} -
{{ .Text | safeHTML }}
+ + + + {{- .Text | safeHTML -}} + + diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index bdb7e122..efa30198 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,19 +1,19 @@ {{- $src := .Page.Resources.GetMatch (printf "*%s*" .Destination) -}} -{{- $img_class := "my-[3.2rem] mx-auto rounded" -}} +{{- $img_class := "mx-auto rounded" -}} {{ if or (hasPrefix .Destination "http://" ) (hasPrefix .Destination "https://" ) }} {{ else if hasSuffix $src ".gif" }} {{ else }} -
- +
+ {{ $resizeOptions := printf "%dx%d webp" $src.Width $src.Height }} {{ $webpImg := $src.Resize $resizeOptions }} {{ .Text }} {{ with .Title }} -
+

{{ . }}

{{ end }} diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 87f69ec3..26869dce 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,7 +1,7 @@ {{ .Text | safeHTML }} \ No newline at end of file diff --git a/layouts/_default/archive.html b/layouts/_default/archive.html index 74c20dd2..0f965d78 100644 --- a/layouts/_default/archive.html +++ b/layouts/_default/archive.html @@ -1,6 +1,6 @@ {{ define "content" }} {{ partial "title" . }} -
+
{{ partial "article-list" . }}
{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index f1b226aa..f0286364 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,10 +1,10 @@ {{ partial "head.html" . }} - -
+ +
{{- partial "header.html" . -}} -
+
{{ block "content" . }}{{ end }}
{{- partial "footer.html" . -}} diff --git a/layouts/articles/single.html b/layouts/articles/single.html index 1993bca9..117efd7e 100644 --- a/layouts/articles/single.html +++ b/layouts/articles/single.html @@ -5,34 +5,34 @@ {{- $next := $pages.ByDate.Reverse.Next . -}} {{ partial "title" . }} -
-
-
{{ .Date.Format "2 Jan 2006" }} +
+
+
{{ .Date.Format "2 Jan 2006" }} {{- if ne .Lastmod .Date }} (upd: {{ .Lastmod.Format "2 Jan 2006" }}) {{ end }}
- -
-  {{- if gt .ReadingTime 1 }}{{ .ReadingTime }} mins{{ else }}1 min{{ end -}} + +
+  {{- if gt .ReadingTime 1 }}{{ .ReadingTime }} mins{{ else }}1 min{{ end -}}
{{ partial "article" . }} -
+
{{ with $prev }} - older + older {{ end }} {{ if and $prev $next }} -   ·   ·   ·   +   ·   ·   ·   {{ end }} {{ with $next }} - newer + newer {{ end }}
{{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 50f0adce..d2b8cfc7 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,6 +1,6 @@ {{ define "content" }} -
+
{{ partial "article-list" . }} - +
{{ end }} diff --git a/layouts/partials/article-list.html b/layouts/partials/article-list.html index df6f8ae2..b32b392f 100644 --- a/layouts/partials/article-list.html +++ b/layouts/partials/article-list.html @@ -6,14 +6,14 @@ {{- range $pages -}} {{- $firstArticle := index .Pages 0 -}}
  • -
    / {{ $firstArticle.Date.Format "January 2006" +
    / {{ $firstArticle.Date.Format "January 2006" }} /
  • -
      +
        {{- range .Pages -}}
      • -
        {{ .Date.Day }}
        +
        {{ .Date.Day }}
        {{ partial "func/MakeTitle" (dict "title" .Title ) }}
      • diff --git a/layouts/partials/article.html b/layouts/partials/article.html index 8a2b0fa8..a87c9c4e 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -1,11 +1,11 @@ -
        + \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 198f0f6a..9db7dcea 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,3 +1,3 @@ -