Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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