mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 07:18:57 +00:00
fix(assets): restructure SCSS pages directory and fix positioning issues
- Restructure SCSS pages directory and rename shared to content - Ensure hr overflow visible for awesome-hr icon - Restore position relative on .page for absolute children
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@use "pages/archives";
|
||||
@@ -3,5 +3,4 @@
|
||||
@forward "code";
|
||||
@forward "content";
|
||||
@forward "fixit-decryptor";
|
||||
@forward "page";
|
||||
@forward "patch";
|
||||
@@ -53,10 +53,12 @@ h1 {
|
||||
}
|
||||
|
||||
// 1. Add the correct box sizing in Firefox.
|
||||
// 2. Ensure `::before` pseudo-element (e.g. awesome-hr icon) is not clipped.
|
||||
|
||||
hr {
|
||||
box-sizing: content-box; // 1
|
||||
height: 0; // 1
|
||||
overflow: visible; // 2
|
||||
}
|
||||
|
||||
// 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@use "wrapper";
|
||||
@use "header";
|
||||
@use "page-style";
|
||||
@use "breadcrumb";
|
||||
@use "page";
|
||||
@use "pagination";
|
||||
@use "comment";
|
||||
@use "footer";
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
@use "core/mixins" as *;
|
||||
|
||||
@include page-style;
|
||||
|
||||
@include page-style('wide') {
|
||||
@include media('xl') {
|
||||
width: ROUND(64%, 2px);
|
||||
max-width: 1600px;
|
||||
}
|
||||
|
||||
@include media('lg') {
|
||||
width: ROUND(60%, 2px);
|
||||
}
|
||||
|
||||
@include media('md') {
|
||||
width: ROUND(56%, 2px);
|
||||
}
|
||||
}
|
||||
|
||||
@include page-style('narrow') {
|
||||
@include media('xl') {
|
||||
max-width: 800px;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
@use "core/mixins" as *;
|
||||
|
||||
.page {
|
||||
position: relative;
|
||||
padding-inline: 0.5rem;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -40,3 +41,26 @@
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
@include page-style;
|
||||
|
||||
@include page-style('wide') {
|
||||
@include media('xl') {
|
||||
width: ROUND(64%, 2px);
|
||||
max-width: 1600px;
|
||||
}
|
||||
|
||||
@include media('lg') {
|
||||
width: ROUND(60%, 2px);
|
||||
}
|
||||
|
||||
@include media('md') {
|
||||
width: ROUND(56%, 2px);
|
||||
}
|
||||
}
|
||||
|
||||
@include page-style('narrow') {
|
||||
@include media('xl') {
|
||||
max-width: 800px;
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
padding: 0.5rem;
|
||||
max-width: 500px;
|
||||
|
||||
&:not(:has(~ aside)) {
|
||||
&:first-of-type:not(:has(~ aside)) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
aside:first-child:not(:empty) ~ aside#toc-auto:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
aside:first-child:empty:has(~ aside:not(:empty)) ~ article,
|
||||
aside:first-child:not(:empty) ~ article:has(~ aside:empty) {
|
||||
flex: 3;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@use "pages/friends";
|
||||
@@ -1,3 +0,0 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@use "pages/home";
|
||||
@@ -1,3 +0,0 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@use "pages/link";
|
||||
@@ -1,5 +1,5 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@use "core";
|
||||
@use "pages";
|
||||
@use "content";
|
||||
@use "widgets";
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
@use "shared";
|
||||
@@ -1,3 +0,0 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@use "pages/posts";
|
||||
@@ -1,3 +0,0 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@use "pages/search";
|
||||
@@ -24,28 +24,35 @@
|
||||
{{- dict "Resource" $mainCSS | partial "plugin/style.html" -}}
|
||||
|
||||
{{- /* Page-specific CSS */ -}}
|
||||
{{- $pageCSSPath := "" -}}
|
||||
{{- if eq .Kind "home" -}}
|
||||
{{- if in .RelPermalink "archives" -}}
|
||||
{{- $pageCSSPath = "scss/archives.scss" -}}
|
||||
{{- else if in .RelPermalink "link" -}}
|
||||
{{- $pageCSSPath = "scss/link.scss" -}}
|
||||
{{- else -}}
|
||||
{{- $pageCSSPath = "scss/home.scss" -}}
|
||||
{{- end -}}
|
||||
{{- else if eq .Kind "page" -}}
|
||||
{{- if eq .Layout "search" -}}
|
||||
{{- $pageCSSPath = "scss/search.scss" -}}
|
||||
{{- else if eq .Layout "friends" -}}
|
||||
{{- $pageCSSPath = "scss/friends.scss" -}}
|
||||
{{- else if eq .Type "posts" -}}
|
||||
{{- $pageCSSPath = "scss/posts.scss" -}}
|
||||
{{- end -}}
|
||||
{{- else if in (slice "section" "taxonomy" "term") .Kind -}}
|
||||
{{- $pageCSSPath = "scss/archives.scss" -}}
|
||||
{{- $pageName := "" -}}
|
||||
{{- $kindsMap := dict
|
||||
"section" "archives"
|
||||
"taxonomy" "archives"
|
||||
"term" "archives"
|
||||
"home" (
|
||||
cond (in .RelPermalink "archives") "archives" (
|
||||
cond (in .RelPermalink "link") "link" (
|
||||
cond (in .RelPermalink "offline") "" "home"
|
||||
)
|
||||
)
|
||||
)
|
||||
"page" (
|
||||
cond (in (slice "search" "friends") .Layout) .Layout (
|
||||
cond (eq .Type "posts") "posts" ""
|
||||
)
|
||||
)
|
||||
-}}
|
||||
{{- with (index $kindsMap .Kind) -}}
|
||||
{{- $pageName = . -}}
|
||||
{{- end -}}
|
||||
{{- with $pageCSSPath -}}
|
||||
{{- dict "Source" . "ToCSS" (dict "vars" $scssVars) "Fingerprint" $fingerprint | partial "plugin/style.html" -}}
|
||||
{{- with $pageName -}}
|
||||
{{- dict
|
||||
"Content" (printf `@use "pages/%s";` .)
|
||||
"Path" (printf "scss/%s.scss" .)
|
||||
"ToCSS" (dict "vars" $scssVars "targetPath" (printf "css/pages/%s.css" .))
|
||||
"Fingerprint" $fingerprint
|
||||
| partial "plugin/style.html"
|
||||
-}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Custom CSS (highest priority) */ -}}
|
||||
|
||||
@@ -114,23 +114,23 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- if fileExists "assets/css/_custom.scss" -}}
|
||||
{{- $warns = $warns | append "The file `assets/css/_custom.scss` is deprecated. Please move your custom styles to `assets/scss/custom.scss`." -}}
|
||||
{{- $warns = $warns | append "The file `assets/css/_custom.scss` is deprecated. Please move your custom styles to `assets/scss/custom.scss`.\nSee: https://fixit.lruihao.cn/docs/advanced/" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if fileExists "assets/css/_override.scss" -}}
|
||||
{{- $warns = $warns | append "The file `assets/css/_override.scss` is deprecated. Use `[params.appearance]` in your site configuration instead." -}}
|
||||
{{- $warns = $warns | append "The file `assets/css/_override.scss` is deprecated. Use `[params.appearance]` in your site configuration instead.\nSee: https://fixit.lruihao.cn/docs/advanced/" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if fileExists "assets/scss/override.scss" -}}
|
||||
{{- $warns = $warns | append "The file `assets/scss/override.scss` is deprecated. Use `[params.appearance]` in your site configuration instead." -}}
|
||||
{{- $warns = $warns | append "The file `assets/scss/override.scss` is deprecated. Use `[params.appearance]` in your site configuration instead.\nSee: https://fixit.lruihao.cn/docs/advanced/" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if fileExists "assets/css/_variables.scss" -}}
|
||||
{{- $warns = $warns | append "The file `assets/css/_variables.scss` is deprecated. Please move your variables to `assets/scss/_variables.scss`." -}}
|
||||
{{- $warns = $warns | append "The file `assets/css/_variables.scss` is deprecated. Please move your variables to `assets/scss/_variables.scss`.\nSee: https://fixit.lruihao.cn/docs/advanced/" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if fileExists "assets/js/_custom.js" -}}
|
||||
{{- $warns = $warns | append "The file `assets/js/_custom.js` is deprecated. Please move your custom scripts to `assets/js/custom.ts` or `assets/js/custom.js`." -}}
|
||||
{{- $warns = $warns | append "The file `assets/js/_custom.js` is deprecated. Please move your custom scripts to `assets/js/custom.ts` or `assets/js/custom.js`.\nSee: https://fixit.lruihao.cn/docs/advanced/" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if len $warns -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mrkfkp6z" -}}
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mrma4qc1" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user