Commit 438aa43

HPCesia <me@hpcesia.com>
2025-02-11 08:56:15
perf: styles enhancement
1 parent 08522cd
Changed files (3)
src/components/utils/Markdown.astro
@@ -23,9 +23,9 @@ const firstHasPre = hasPre && (isFirstInstance('md-has-pre', Astro.url) || impor
   firstHasPre && (
     <template
       id="code-toolbar-template"
-      class="code-block-wrapper collapse-open collapse relative my-4"
+      class="code-block-wrapper collapse-open collapse my-4 w-[initial]"
     >
-      <div class="bg-primary/60 text-primary-content z-10 flex items-center justify-between">
+      <div class="bg-primary/60 text-primary-content z-10 flex w-full items-center justify-between">
         <Button class="toggle-btn btn-ghost btn-primary rounded-bl-none">
           <Icon
             name="material-symbols:keyboard-arrow-down-rounded"
@@ -37,7 +37,7 @@ const firstHasPre = hasPre && (isFirstInstance('md-has-pre', Astro.url) || impor
           <Icon name="material-symbols:file-copy-rounded" class="h-5 w-5 duration-300" />
         </Button>
       </div>
-      <div class="collapse-content !p-0" />
+      <div class="collapse-content w-full !p-0" />
     </template>
   )
 }
src/styles/markdown.css
@@ -277,7 +277,7 @@ article {
 
   /* 折叠块样式 */
   details {
-    @apply border-base-300 w-full overflow-hidden rounded-xl border-[1px] duration-300;
+    @apply border-base-300 relative w-full overflow-hidden rounded-xl border duration-300;
 
     summary {
       @apply hover:bg-primary/50 w-full px-3 py-1 text-start text-lg duration-300;
@@ -294,7 +294,11 @@ article {
     }
 
     > :not(summary) {
-      @apply p-3;
+      @apply mx-8;
+    }
+
+    > :last-child {
+      @apply mb-4;
     }
   }
 
src/styles/twikoo.css
@@ -4,12 +4,12 @@
 
 .twikoo {
   @apply relative flex h-fit w-full flex-col items-center;
-}
 
-input,
-textarea,
-select {
-  border: none;
+  input,
+  textarea,
+  select {
+    border: none;
+  }
 }
 
 .tk-comments {