Commit 7abdf46

HPCesia <me@hpcesia.com>
2025-11-25 12:19:45
fix: ghost button text color
btn behavior changed in DaisyUI 5.5
1 parent 496f5dc
Changed files (2)
src/components/misc/CategoryBar.astro
@@ -24,7 +24,7 @@ const { categories, currentCategory } = Astro.props;
       href={`/`}
       class:list={[
         'btn btn-ghost btn-primary h-8 min-h-8 rounded-md px-3 py-0',
-        currentCategory ? '' : 'btn-active',
+        currentCategory ? 'not-hover:text-base-content' : 'btn-active',
       ]}
     >
       {t.navigation.recentPosts()}
@@ -35,7 +35,7 @@ const { categories, currentCategory } = Astro.props;
           href={getCategoryUrl(category)}
           class:list={[
             'btn btn-ghost btn-primary h-8 min-h-8 rounded-md px-3 py-0',
-            currentCategory === category ? 'btn-active' : '',
+            currentCategory === category ? 'btn-active' : 'not-hover:text-base-content',
           ]}
         >
           {category}
src/components/Navbar.astro
@@ -25,7 +25,11 @@ const drawerItemClass =
       class="navbar bg-base-200/50 fixed z-20 flex h-16 w-full items-center backdrop-blur-md"
     >
       <div class="navbar-start">
-        <Button id="site-name" href="/" class="group btn-ghost btn-accent">
+        <Button
+          id="site-name"
+          href="/"
+          class="group btn-ghost btn-accent not-hover:text-base-content"
+        >
           <span class="text-xl font-bold duration-300 group-hover:opacity-0">{title}</span>
           <Icon
             name="material-symbols:home-rounded"
@@ -39,7 +43,10 @@ const drawerItemClass =
             if ('items' in item) {
               return (
                 <div class="dropdown dropdown-center dropdown-hover">
-                  <Button title={item.title} class="btn-ghost join-item btn-primary">
+                  <Button
+                    title={item.title}
+                    class="btn-ghost join-item btn-primary not-hover:text-base-content"
+                  >
                     <span class="text-xl tracking-wide">{item.title}</span>
                   </Button>
                   <ul class="menu bg-base-200/50 dropdown-content absolute rounded-xl shadow">
@@ -58,7 +65,7 @@ const drawerItemClass =
                         {...(subItem.extraAttr || {})}
                         title={subItem.text}
                         aria-label={subItem.text}
-                        class="btn-ghost btn-primary rounded-field"
+                        class="btn-ghost btn-primary not-hover:text-base-content rounded-field"
                       >
                         <span class="text-xl tracking-wide text-nowrap">{subItem.text}</span>
                       </Button>
@@ -82,7 +89,7 @@ const drawerItemClass =
                   {...(item.extraAttr || {})}
                   title={item.text}
                   aria-label={item.text}
-                  class="btn-ghost join-item btn-primary"
+                  class="btn-ghost join-item btn-primary not-hover:text-base-content"
                 >
                   <span class="text-xl tracking-wide">{item.text}</span>
                 </Button>
@@ -96,7 +103,7 @@ const drawerItemClass =
           {
             navbarConfig.navbarRightItems.onlyWide.map((item) => (
               <Button
-                class="nav-menu-item btn-circle btn-ghost btn-primary"
+                class="nav-menu-item btn-circle btn-ghost btn-primary not-hover:text-base-content"
                 {...('href' in item &&
                   item.href && { href: item.href, target: item.blank ? '_blank' : undefined })}
                 title={item.text}
@@ -117,7 +124,7 @@ const drawerItemClass =
           {
             navbarConfig.navbarRightItems.always.map((item) => (
               <Button
-                class="nav-menu-item btn-circle btn-ghost btn-primary"
+                class="nav-menu-item btn-circle btn-ghost btn-primary not-hover:text-base-content"
                 {...('href' in item &&
                   item.href && { href: item.href, target: item.blank ? '_blank' : undefined })}
                 title={item.text}
@@ -137,7 +144,7 @@ const drawerItemClass =
         <div class="md:hidden">
           <label
             for="sidebar-drawer"
-            class="btn btn-circle btn-ghost btn-primary"
+            class="btn btn-circle btn-ghost btn-primary not-hover:text-base-content"
             tabindex="0"
             title={t.info.openMenu()}
             aria-label={t.info.openMenu()}