summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-07-15 23:51:25 +0800
committerEltrac <hi@guhub.cn>2025-07-15 23:51:25 +0800
commit764e20e3ebabcb1f38f6a91c3b09de2473cadb5d (patch)
treeaf1394fd393976380d21010e379c03b95ac8810c /assets
parenteddcb141d0afc462d976fdbe09ef2dc7c3f9159e (diff)
refactor: gallery styles and update imports
Moved gallery shortcode styles from _post.scss to _markdown.scss and deleted the unused _post.scss file. Updated import paths in content.scss and global.scss to reflect the new location of markdown styles.
Diffstat (limited to 'assets')
-rw-r--r--assets/css/_markdown.scss (renamed from assets/css/components/_markdown.scss)59
-rw-r--r--assets/css/components/_post.scss57
-rw-r--r--assets/css/content.scss4
-rw-r--r--assets/css/global.scss3
4 files changed, 54 insertions, 69 deletions
diff --git a/assets/css/components/_markdown.scss b/assets/css/_markdown.scss
index 9acd73d4..f7c99600 100644
--- a/assets/css/components/_markdown.scss
+++ b/assets/css/_markdown.scss
@@ -177,11 +177,58 @@ $em-text-color: #889E73;
}
}
-/* additional elements */
+/* gallery shortcode */
-.link-icon img {
- width: 0.8em;
- height: 0.8em;
- display: inline;
- opacity: 0.7;
+.gallery {
+ display: flex;
+ overflow-x: auto;
+ scroll-behavior: smooth;
+ gap: 0.5rem;
+ white-space: nowrap;
+
+ & > figure, & > a:has(> figure) {
+ margin: 0;
+ flex-shrink: 0;
+ display: inline-block;
+ max-width: 100%;
+ position: relative;
+ box-shadow: inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.1);
+ img {
+ height: 20rem;
+ display: block;
+ border-radius: 4px;
+ margin: 0;
+ }
+ figcaption {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ padding: 0.35rem;
+ h4 {
+ font-size: 0.8rem;
+ margin: 0;
+ text-align: left;
+ width: fit-content;
+ color: var(--text-color);
+ background-color: rgba(var(--block-background-color-rgb), 0.75);
+ backdrop-filter: blur(0.5rem);
+ padding: 0.2rem 0.35rem;
+ border-radius: 3px;
+ line-height: 1.2;
+ }
+ }
+ }
+ & > p { display: none }
+
+ &.center {
+ justify-content: center;
+ }
+ &.full-width {
+ & > figure {
+ flex-shrink: unset;
+ img {
+ width: 100%;
+ }
+ }
+ }
}
diff --git a/assets/css/components/_post.scss b/assets/css/components/_post.scss
deleted file mode 100644
index 4ffe742c..00000000
--- a/assets/css/components/_post.scss
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-/* gallery shortcode */
-
-.gallery {
- display: flex;
- overflow-x: auto;
- scroll-behavior: smooth;
- gap: 0.5rem;
- white-space: nowrap;
-
- & > figure, & > a:has(> figure) {
- margin: 0;
- flex-shrink: 0;
- display: inline-block;
- max-width: 100%;
- position: relative;
- box-shadow: inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.1);
- img {
- height: 20rem;
- display: block;
- border-radius: 4px;
- margin: 0;
- }
- figcaption {
- position: absolute;
- bottom: 0;
- left: 0;
- padding: 0.35rem;
- h4 {
- font-size: 0.8rem;
- margin: 0;
- text-align: left;
- width: fit-content;
- color: var(--text-color);
- background-color: rgba(var(--block-background-color-rgb), 0.75);
- backdrop-filter: blur(0.5rem);
- padding: 0.2rem 0.35rem;
- border-radius: 3px;
- line-height: 1.2;
- }
- }
- }
- & > p { display: none }
-
- &.center {
- justify-content: center;
- }
- &.full-width {
- & > figure {
- flex-shrink: unset;
- img {
- width: 100%;
- }
- }
- }
-}
diff --git a/assets/css/content.scss b/assets/css/content.scss
index 7fba283f..ca707daf 100644
--- a/assets/css/content.scss
+++ b/assets/css/content.scss
@@ -1,6 +1,2 @@
-@import "utils/mixins";
-
-@import "components/post";
-
@import "libraries/littlefoot";
@import "libraries/fancybox";
diff --git a/assets/css/global.scss b/assets/css/global.scss
index c4fe59a1..807b946d 100644
--- a/assets/css/global.scss
+++ b/assets/css/global.scss
@@ -3,5 +3,4 @@
@import "utils/reset";
@import "utils/utility";
@import "utils/animation";
-
-@import "components/markdown";
+@import "markdown";