소스 검색

Update style

Track3 8 달 전
부모
커밋
0d4ee2e7cc
4개의 변경된 파일30개의 추가작업 그리고 17개의 파일을 삭제
  1. 23 10
      assets/scss/style.scss
  2. 4 2
      layouts/_default/baseof.html
  3. 0 1
      layouts/index.html
  4. 3 4
      layouts/shortcodes/photo.html

+ 23 - 10
assets/scss/style.scss

@@ -1,4 +1,4 @@
-@import "predefined.scss", "syntax.scss";
+@import "predefined.scss";
 
 *,
 ::before,
@@ -46,15 +46,15 @@ html {
   -moz-tab-size: 4;
   tab-size: 4;
   scroll-behavior: smooth;
-}
-
-body {
   --c-bg: #f3f6f6;
   --c-bg-alt: #dee8e5;
   --c-txt: #545250;
   --c-txt-alt: #72706e;
   --c-txt-alt2: rgba(114, 112, 110, .3);
   --c-txt-em: #333333;
+}
+
+body {
   display: flex;
   justify-content: center;
   gap: 1rem;
@@ -78,7 +78,7 @@ textarea {
 
 // Auto light/dark mode
 @media (prefers-color-scheme: dark) {
-  body {
+  html {
     --c-bg: #1c1f21;
     --c-bg-alt: #313a3f;
     --c-txt: #bababa;
@@ -352,6 +352,8 @@ textarea {
 }
 
 .back-btn {
+  display: inline-block;
+  width: 100%;
   font-size: 125%;
 }
 
@@ -361,15 +363,18 @@ h1 {
   line-height: 1.4;
 }
 
+.site-title {
+  margin-top: .5rem;
+}
+
 .section {
-  margin-top: 2rem;
+  margin-top: 1.5rem;
 }
 
 .section-title {
   display: flex;
   justify-content: space-between;
   align-items: center;
-  padding-bottom: .25rem;
   border-bottom: 1px dashed var(--c-bg-alt);
 
   h2 {
@@ -394,7 +399,7 @@ a.section-title:hover {
   justify-content: space-between;
   align-items: center;
   gap: 1rem;
-  padding: .5em 0;
+  padding: .375em 0;
   border-bottom: 1px dashed var(--c-bg-alt);
   transition: border-color .3s;
 
@@ -472,7 +477,7 @@ a.section-title:hover {
     color: var(--c-txt-alt);
 
     &::before {
-      content: "";
+      content: "";
       margin-right: .25em;
       color: var(--c-txt-alt2);
     }
@@ -563,7 +568,7 @@ a.footnote-ref {
   object-fit: cover;
 }
 
-@import "partials/comments";
+@import "syntax.scss", "partials/comments";
 
 @media all and (min-width: 55em) {
   body {
@@ -572,10 +577,18 @@ a.footnote-ref {
 }
 
 @media all and (min-width: 81em) {
+  body {
+    padding-top: 5rem;
+  }
+
   .back-btn {
     display: none;
   }
 
+  .site-title {
+    margin-top: 0;
+  }
+
   .site-header {
     display: block;
     flex-basis: 14rem;

+ 4 - 2
layouts/_default/baseof.html

@@ -57,10 +57,12 @@
 
 	<div class="wrapper">
 		<main>
-			{{ if not .IsHome -}}
+			{{ if .IsHome -}}
+			<h1 class="site-title">{{.Title}}</h1>
+			{{ else -}}
 			<a title="主页" href="{{"" | relURL}}" class="tdln dim back-btn">←</a>
-			{{ end -}}
 			<h1>{{.Title}}</h1>
+			{{ end -}}
 			{{ block "main" . }}
 			{{ end }}
 		</main>

+ 0 - 1
layouts/index.html

@@ -2,7 +2,6 @@
 		{{ if .Content -}}
 		<div class="content">
 			{{ .Content }}
-			<hr>
 		</div>
 		{{- end }}
 		<section class="section content">

+ 3 - 4
layouts/shortcodes/photo.html

@@ -14,15 +14,14 @@
 		{{ end -}}
 		{{ if or (.Get "caption") $image.Exif -}}
 		<p>
-			{{- .Get "caption" | markdownify -}}
 			{{ with $image.Exif -}}
 			<span>【
 				{{- with .Tags.FocalLength }}{{.}}mm{{ end -}}
 				{{ with .Tags.ApertureValue }}, &fnof;/{{ lang.FormatNumber 1 . }}{{ end -}}
 				{{ with .Tags.ExposureTime }}, {{.}}s{{ end -}}
-				{{ with .Tags.ISO }}, ISO{{.}}{{ end }}】
-			</span>
-			{{ end -}}
+				{{ with .Tags.ISO }}, ISO{{.}}{{ end }}】</span>
+			{{- end -}}
+			{{- .Get "caption" | markdownify -}}
 		</p>
 		{{ end -}}
 	</figcaption>