📝 Docs: 商店卡片样式调整 (#2633)

This commit is contained in:
StarHeart 2024-04-08 20:22:29 +08:00 committed by GitHub
parent 0b972ad302
commit ca32f68787
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 19 deletions

View File

@ -40,8 +40,10 @@ export default function ResourceCard({
return ( return (
<div className={clsx("resource-card-container", className)}> <div className={clsx("resource-card-container", className)}>
<div className="resource-card-header"> <div className="resource-card-header">
<div className="resource-card-header-title flex items-center"> <div className="resource-card-header-title">
{resource.name} <div className="resource-card-header-text" data-tip={resource.name}>
<div className="truncate min-w-0">{resource.name}</div>
</div>
{resource.is_official && ( {resource.is_official && (
<FontAwesomeIcon <FontAwesomeIcon
className="resource-card-header-check" className="resource-card-header-check"
@ -49,6 +51,7 @@ export default function ResourceCard({
/> />
)} )}
<ValidStatus <ValidStatus
className="mx-2"
resource={resource} resource={resource}
validLink={registryLink as string} validLink={registryLink as string}
simple simple

View File

@ -7,14 +7,18 @@
} }
&-header { &-header {
@apply flex items-center w-full text-lg font-medium; @apply min-w-0 flex items-center w-full text-lg font-medium;
&-title { &-title {
@apply grow text-left truncate; @apply min-w-0 grow justify-start flex items-center flex-initial;
}
&-text {
@apply min-w-0 cursor-help tooltip;
} }
&-check { &-check {
@apply ml-2 text-success/90 fill-current; @apply ml-2 text-green-600 dark:text-green-400 fill-current;
} }
&-expand { &-expand {

View File

@ -114,7 +114,7 @@ export default function ResourceDetailCard({ resource }: Props) {
<span className="detail-card-title-main flex items-center gap-x-1"> <span className="detail-card-title-main flex items-center gap-x-1">
{resource.name} {resource.name}
{resource.is_official && ( {resource.is_official && (
<div className="rounded-md text-sm bg-success/10 text-success px-1 py-0.5"> <div className="rounded-md text-sm bg-green-400/10 text-green-600 px-1 py-0.5">
</div> </div>
)} )}
@ -189,9 +189,7 @@ export default function ResourceDetailCard({ resource }: Props) {
href={homepageLink} href={homepageLink}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
className={ className={homepageLink && "hover:underline hover:text-primary"}
homepageLink ? "hover:underline hover:text-primary" : undefined
}
> >
{moduleName} {moduleName}
</a> </a>
@ -204,9 +202,7 @@ export default function ResourceDetailCard({ resource }: Props) {
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
className={ className={
pypiProjectLink pypiProjectLink && "hover:underline hover:text-primary"
? "hover:underline hover:text-primary"
: undefined
} }
> >
{projectLink} {projectLink}

View File

@ -59,13 +59,12 @@ export default function ValidDisplay({
className={clsx({ className={clsx({
"rounded-md text-sm flex items-center gap-x-1 px-2 py-1 whitespace-nowrap": "rounded-md text-sm flex items-center gap-x-1 px-2 py-1 whitespace-nowrap":
!simple, !simple,
"ml-2": simple, "bg-green-400/10": !simple && isValid,
"bg-success/10": !simple && isValid, "text-green-600 dark:text-green-400": isValid,
"text-success/90": isValid, "bg-red-400/10": !simple && isInvalid,
"bg-error/10": !simple && isInvalid, "text-red-600 dark:text-red-400": isInvalid,
"text-error/90": isInvalid, "bg-blue-400/10": !simple && isSkip,
"bg-info/10": !simple && isSkip, "text-blue-600 dark:text-blue-400": isSkip,
"text-info/90": isSkip,
})} })}
> >
<FontAwesomeIcon icon={validIcons[validStatus]} /> <FontAwesomeIcon icon={validIcons[validStatus]} />

View File

@ -17,6 +17,7 @@ function excludeThemeColor(theme, exclude) {
} }
module.exports = { module.exports = {
darkMode: ["class", '[data-theme="dark"]'],
daisyui: { daisyui: {
themes: [ themes: [
{ {