diff --git a/assets/css/.gitignore b/assets/css/.gitignore new file mode 100644 index 0000000..c94d1fd --- /dev/null +++ b/assets/css/.gitignore @@ -0,0 +1 @@ +chroma.css \ No newline at end of file diff --git a/static/css/itix.css b/assets/css/itix.css similarity index 95% rename from static/css/itix.css rename to assets/css/itix.css index e0c879e..4548401 100644 --- a/static/css/itix.css +++ b/assets/css/itix.css @@ -1,8 +1,8 @@ :root { /* - * Theme colors + * Theme colors */ - --main-color: #1976d2; + --main-color: #1975d2; /* Adjusted to ensure a 4.5:1 contrast ratio for accessibility */ --main-background-color: #fcfcfc; --alternate-text-color: #145ca4; --main-text-color: #092949; /* 50% darker than main-color */ @@ -29,9 +29,9 @@ /* * Fonts */ - --default-font-list: "Source Serif Pro"; + --default-font-list: "Source Serif Pro", serif; --mono-font-list: "JetBrains Mono", monospace; - --sans-preferred-font-list: "Source Sans Pro"; + --sans-preferred-font-list: "Source Sans Pro", sans-serif; } @@ -45,6 +45,13 @@ url('/fonts/JetBrainsMono-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; + + /* + * Core Web Vitals / Cumulative Layout Shift. + * + * Avoid showing invisible text while custom fonts load. + */ + font-display: swap; } @font-face{ @@ -52,6 +59,13 @@ src: url('/fonts/SourceSerifPro-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; + + /* + * Core Web Vitals / Cumulative Layout Shift. + * + * Avoid showing invisible text while custom fonts load. + */ + font-display: swap; } @font-face{ @@ -59,6 +73,13 @@ src: url('/fonts/SourceSansPro-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; + + /* + * Core Web Vitals / Cumulative Layout Shift. + * + * Avoid showing invisible text while custom fonts load. + */ + font-display: swap; } @font-face { @@ -290,7 +311,6 @@ pre:hover { * i18n */ .tiny-flag { - height: 0.9rem; vertical-align: middle; margin-left: 5px; margin-right: 5px; diff --git a/layouts/partials/article-headline.html b/layouts/partials/article-headline.html index 1397a6c..75d8afc 100644 --- a/layouts/partials/article-headline.html +++ b/layouts/partials/article-headline.html @@ -3,7 +3,7 @@

{{ .current.Title }} {{- partial "lang-detection.html" .current -}} {{ if .current.Scratch.Get "en_article_in_fr_site" }} - en flag + en flag {{ end }}

{{- partial "post-metadata.html" . -}} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index fcb9c48..d9992d0 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -2,6 +2,30 @@ {{.Title}} + +{{ $chroma := resources.Get "css/chroma.css" }} +{{ $itix := resources.Get "css/itix.css" }} +{{ $css := slice $chroma $itix | resources.Concat "css/itix.css" | resources.Minify | resources.Fingerprint "sha512" }} + + + + + + + + + + + + + {{ if .IsHome -}} {{- else -}} @@ -30,10 +54,6 @@ {{ template "_internal/opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} - - - - {{ if eq .Type "search" }} {{- range .AllTranslations }} - {{ .Lang }} flag + {{ .Lang }} flag {{- end -}} {{- else -}} {{- range site.Sites }} - {{ .Language.Lang }} flag + {{ .Language.Lang }} flag {{- end -}} {{- end }}