mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 13:56:22 -04:00
extract inline page styles into a separate CSS file, and scope to content via SCSS
styles on AMP pages still won't be scoped to div#content like vanilla pages, though
This commit is contained in:
parent
2fa95de9b1
commit
124d55a99e
@ -10,13 +10,11 @@ tags:
|
|||||||
- GitHub
|
- GitHub
|
||||||
image: "covid19dashboards.png"
|
image: "covid19dashboards.png"
|
||||||
css: |
|
css: |
|
||||||
/* disable link underlines for octocats */
|
|
||||||
h2 a:last-child {
|
h2 a:last-child {
|
||||||
background-image: none !important;
|
background-image: none;
|
||||||
padding-bottom: 0 !important;
|
padding-bottom: 0;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
/* align octocat with text */
|
|
||||||
h2 img {
|
h2 img {
|
||||||
vertical-align: text-bottom;
|
vertical-align: text-bottom;
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,9 @@ tags:
|
|||||||
- Dorking
|
- Dorking
|
||||||
image: "shodan.png"
|
image: "shodan.png"
|
||||||
css: |
|
css: |
|
||||||
/* disable hover underlines for search links */
|
|
||||||
h3 a:last-child, h4 a:last-child {
|
h3 a:last-child, h4 a:last-child {
|
||||||
background-image: none !important;
|
background-image: none;
|
||||||
padding-bottom: 0 !important;
|
padding-bottom: 0;
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
}
|
}
|
||||||
draft: false
|
draft: false
|
||||||
|
@ -219,7 +219,7 @@
|
|||||||
|
|
||||||
{{/* Page-specific styles set via front matter */}}
|
{{/* Page-specific styles set via front matter */}}
|
||||||
{{- with .Params.css }}
|
{{- with .Params.css }}
|
||||||
{{- . | safeCSS -}}
|
{{- replace . " !important" "" | safeCSS -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "style.css") | resources.PostCSS (dict "config" "postcss.config.js") }}
|
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "style.css") | resources.PostCSS (dict "config" "postcss.config.js") }}
|
||||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||||
|
|
||||||
{{/* Page-specific styles set via front matter */}}
|
{{/* Page-specific styles set via front matter, scoped via SCSS */}}
|
||||||
{{ with .Params.css }}
|
{{ with .Params.css }}
|
||||||
<style>
|
{{- $sass := printf "div#content { %s }" . }}
|
||||||
{{ . | safeCSS }}
|
{{- $target := path.Join $.File.Dir "inline.scss" }}
|
||||||
</style>
|
|
||||||
|
{{- $css := $sass | resources.FromString $target | resources.ToCSS | resources.PostCSS (dict "config" "postcss.config.js") -}}
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="{{ $css.Permalink }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user