fix: style improvements

This commit is contained in:
saicaca 2023-11-08 10:36:59 +08:00
parent b171ad463e
commit 3798fd6b64
7 changed files with 17 additions and 12 deletions

View File

@ -93,6 +93,8 @@ color_set({
--link-hover: oklch(0.95 0.025 var(--hue)) oklch(0.40 0.08 var(--hue)) --link-hover: oklch(0.95 0.025 var(--hue)) oklch(0.40 0.08 var(--hue))
--link-active: oklch(0.90 0.05 var(--hue)) oklch(0.35 0.07 var(--hue)) --link-active: oklch(0.90 0.05 var(--hue)) oklch(0.35 0.07 var(--hue))
--float-panel-bg: white oklch(0.19 0.015 var(--hue))
--color-selection-bar: rainbow-light rainbow-dark --color-selection-bar: rainbow-light rainbow-dark
--display-light-icon: 1 0 --display-light-icon: 1 0
@ -121,7 +123,13 @@ color_set({
@apply drop-shadow-[0_2px_4px_rgba(0,0,0,0.005)] @apply drop-shadow-[0_2px_4px_rgba(0,0,0,0.005)]
} }
.link { .link {
@apply transition hover:bg-[var(--link-hover)] active:bg-[var(--link-active)] rounded-md p-[4px] -m-[4px];
}
.link-lg {
@apply transition hover:bg-[var(--link-hover)] active:bg-[var(--link-active)] rounded-md p-[6px] -m-[6px]; @apply transition hover:bg-[var(--link-hover)] active:bg-[var(--link-active)] rounded-md p-[6px] -m-[6px];
} }
.float-panel {
@apply rounded-[var(--radius-large)] overflow-hidden bg-[var(--float-panel-bg)] transition shadow-xl dark:shadow-none
}
} }
</style> </style>

View File

@ -36,7 +36,7 @@ const className = Astro.props.class;
class="with-divider" class="with-divider"
> >
<a href=`/archive/category/${category}` aria-label=`View all posts in the ${category} category` <a href=`/archive/category/${category}` aria-label=`View all posts in the ${category} category`
class="link transition text-black/50 dark:text-white/50 text-sm font-medium class="link-lg transition text-black/50 dark:text-white/50 text-sm font-medium
hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap"> hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap">
{category} {category}
</a> </a>
@ -56,7 +56,7 @@ const className = Astro.props.class;
class="with-divider" class="with-divider"
> >
<a href=`/archive/tag/${tag}` aria-label=`View all posts with the ${tag} tag` <a href=`/archive/tag/${tag}` aria-label=`View all posts with the ${tag} tag`
class="link transition text-black/50 dark:text-white/50 text-sm font-medium class="link-lg transition text-black/50 dark:text-white/50 text-sm font-medium
hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap"> hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap">
{tag} {tag}
</a> </a>

View File

@ -70,6 +70,7 @@ const className = Astro.props.class;
color: var(--primary) color: var(--primary)
blockquote blockquote
font-style: normal font-style: normal
font-weight: inherit
border-left-color: rgba(0,0,0,0) border-left-color: rgba(0,0,0,0)
position: relative; position: relative;
&:before &:before

View File

@ -6,9 +6,7 @@ import {siteConfig} from "../../config";
const enableBanner = siteConfig.banner.enable; const enableBanner = siteConfig.banner.enable;
--- ---
<div id="display-setting" class:list={["card-base closed absolute transition-all w-[320px] fixed right-4 border-[var(--primary)] px-4 py-4", <div id="display-setting" class:list={["float-panel closed absolute transition-all w-[320px] fixed right-4 px-4 py-4"]}>
{"border-[3px]": !enableBanner}
]}>
<div class="flex flex-row gap-2 mb-3 items-center justify-between"> <div class="flex flex-row gap-2 mb-3 items-center justify-between">
<div class="font-bold text-lg text-neutral-900 dark:text-neutral-100 transition relative ml-3 <div class="font-bold text-lg text-neutral-900 dark:text-neutral-100 transition relative ml-3
before:w-1 before:h-4 before:rounded-md before:bg-[var(--primary)] before:w-1 before:h-4 before:rounded-md before:bg-[var(--primary)]

View File

@ -12,11 +12,9 @@ const links = Astro.props.links;
const enableBanner = siteConfig.banner.enable; const enableBanner = siteConfig.banner.enable;
--- ---
<div id="nav-menu-panel" class:list={["card-base closed absolute transition-all fixed right-4 border-[var(--primary)] px-2 py-2", <div id="nav-menu-panel" class:list={["float-panel closed absolute transition-all fixed right-4 px-2 py-2"]}>
{"border-[3px]": !enableBanner}
]}>
{links.map((link) => ( {links.map((link) => (
<a href={link.url} class="group flex justify-between items-center py-2 pl-3 pr-1 rounded-md gap-8 <a href={link.url} class="group flex justify-between items-center py-2 pl-3 pr-1 rounded-lg gap-8
hover:bg-[var(--btn-plain-bg-hover)] active:bg-[var(--btn-plain-bg-active)] transition hover:bg-[var(--btn-plain-bg-hover)] active:bg-[var(--btn-plain-bg-active)] transition
" "
target={link.external ? "_blank" : null} target={link.external ? "_blank" : null}

View File

@ -12,13 +12,13 @@ const config = profileConfig;
--- ---
<div class="card-base"> <div class="card-base">
<a aria-label="Go to About Page" href="/about" class="group block relative m-3 overflow-hidden rounded-xl active:scale-95"> <a aria-label="Go to About Page" href="/about" class="group block relative mx-auto mt-4 lg:mx-3 lg:mt-3 mb-3 max-w-[240px] lg:max-w-none overflow-hidden rounded-xl active:scale-95">
<div class="absolute transition pointer-events-none group-hover:bg-black/30 group-active:bg-black/50 w-full h-full z-50 flex items-center justify-center"> <div class="absolute transition pointer-events-none group-hover:bg-black/30 group-active:bg-black/50 w-full h-full z-50 flex items-center justify-center">
<Icon name="fa6-regular:address-card" <Icon name="fa6-regular:address-card"
class="transition opacity-0 group-hover:opacity-100 text-white text-5xl"> class="transition opacity-0 group-hover:opacity-100 text-white text-5xl">
</Icon> </Icon>
</div> </div>
<ImageBox src={config.avatar} alt="Profile Image of the Author" class="mt-1 mx-auto w-[240px] lg:w-full h-full lg:mt-0 "></ImageBox> <ImageBox src={config.avatar} alt="Profile Image of the Author" class="mx-auto lg:w-full h-full lg:mt-0 "></ImageBox>
</a> </a>
<div class="font-bold text-xl text-center mb-1 dark:text-neutral-50 transition">{config.name}</div> <div class="font-bold text-xl text-center mb-1 dark:text-neutral-50 transition">{config.name}</div>
<div class="h-1 w-5 bg-[var(--primary)] mx-auto rounded-full mb-2 transition"></div> <div class="h-1 w-5 bg-[var(--primary)] mx-auto rounded-full mb-2 transition"></div>

View File

@ -23,7 +23,7 @@ const enableBanner = siteConfig.banner.enable;
<Layout title={title} banner={banner}> <Layout title={title} banner={banner}>
<div class=`max-w-[var(--page-width)] min-h-screen grid grid-cols-[280px_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto] <div class=`max-w-[var(--page-width)] min-h-screen grid grid-cols-[280px_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto]
mx-auto gap-4 relative md:px-4 lg:px-0` mx-auto gap-4 relative px-3 md:px-4 lg:px-0`
transition:animate="none" transition:animate="none"
> >
<div id="top-row" class="col-span-2 grid-rows-1 z-50" class:list={["transition-all", { <div id="top-row" class="col-span-2 grid-rows-1 z-50" class:list={["transition-all", {