Skip to content

Commit

Permalink
📝 Docs: 商店卡片样式调整 (#2633)
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt authored Apr 8, 2024
1 parent 0b972ad commit ca32f68
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
7 changes: 5 additions & 2 deletions website/src/components/Resource/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ export default function ResourceCard({
return (
<div className={clsx("resource-card-container", className)}>
<div className="resource-card-header">
<div className="resource-card-header-title flex items-center">
{resource.name}
<div className="resource-card-header-title">
<div className="resource-card-header-text" data-tip={resource.name}>
<div className="truncate min-w-0">{resource.name}</div>
</div>
{resource.is_official && (
<FontAwesomeIcon
className="resource-card-header-check"
icon={["fas", "circle-check"]}
/>
)}
<ValidStatus
className="mx-2"
resource={resource}
validLink={registryLink as string}
simple
Expand Down
10 changes: 7 additions & 3 deletions website/src/components/Resource/Card/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
}

&-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 {
@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 {
@apply ml-2 text-success/90 fill-current;
@apply ml-2 text-green-600 dark:text-green-400 fill-current;
}

&-expand {
Expand Down
10 changes: 3 additions & 7 deletions website/src/components/Resource/DetailCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default function ResourceDetailCard({ resource }: Props) {
<span className="detail-card-title-main flex items-center gap-x-1">
{resource.name}
{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>
)}
Expand Down Expand Up @@ -189,9 +189,7 @@ export default function ResourceDetailCard({ resource }: Props) {
href={homepageLink}
target="_blank"
rel="noreferrer"
className={
homepageLink ? "hover:underline hover:text-primary" : undefined
}
className={homepageLink && "hover:underline hover:text-primary"}
>
{moduleName}
</a>
Expand All @@ -204,9 +202,7 @@ export default function ResourceDetailCard({ resource }: Props) {
target="_blank"
rel="noreferrer"
className={
pypiProjectLink
? "hover:underline hover:text-primary"
: undefined
pypiProjectLink && "hover:underline hover:text-primary"
}
>
{projectLink}
Expand Down
13 changes: 6 additions & 7 deletions website/src/components/Resource/ValidStatus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@ export default function ValidDisplay({
className={clsx({
"rounded-md text-sm flex items-center gap-x-1 px-2 py-1 whitespace-nowrap":
!simple,
"ml-2": simple,
"bg-success/10": !simple && isValid,
"text-success/90": isValid,
"bg-error/10": !simple && isInvalid,
"text-error/90": isInvalid,
"bg-info/10": !simple && isSkip,
"text-info/90": isSkip,
"bg-green-400/10": !simple && isValid,
"text-green-600 dark:text-green-400": isValid,
"bg-red-400/10": !simple && isInvalid,
"text-red-600 dark:text-red-400": isInvalid,
"bg-blue-400/10": !simple && isSkip,
"text-blue-600 dark:text-blue-400": isSkip,
})}
>
<FontAwesomeIcon icon={validIcons[validStatus]} />
Expand Down
1 change: 1 addition & 0 deletions website/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function excludeThemeColor(theme, exclude) {
}

module.exports = {
darkMode: ["class", '[data-theme="dark"]'],
daisyui: {
themes: [
{
Expand Down

0 comments on commit ca32f68

Please sign in to comment.