Skip to content

Commit

Permalink
💄 Add transition to doc breadcrumbs and version badge
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Sep 26, 2023
1 parent 52de9c3 commit 72e5413
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function HomeBreadcrumbItem(): JSX.Element {
message: "Home page",
description: "The ARIA label for the home page in the breadcrumbs",
})}
className="breadcrumbs-btn"
className="btn btn-ghost btn-xs no-animation breadcrumbs-btn"
href={homeHref}
>
<IconHome />
Expand Down
6 changes: 3 additions & 3 deletions packages/theme-nonepress/src/theme/DocBreadcrumbs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { type ReactNode } from "react";

import clsx from "clsx";

import "./styles.css";
import Link from "@docusaurus/Link";
import { translate } from "@docusaurus/Translate";
import { ThemeClassNames } from "@docusaurus/theme-common";
Expand All @@ -11,6 +10,7 @@ import {
useHomePageRoute,
} from "@docusaurus/theme-common/internal";

import "./styles.css";
import HomeBreadcrumbItem from "@theme/DocBreadcrumbs/Items/Home";

function BreadcrumbsItemLink({
Expand All @@ -22,11 +22,11 @@ function BreadcrumbsItemLink({
href: string | undefined;
isLast: boolean;
}): JSX.Element {
const className = "breadcrumbs-btn";
const className = "btn btn-ghost btn-xs no-animation breadcrumbs-btn";
if (isLast) {
return (
<span
className={clsx(className, "breadcrumbs-btn-active")}
className={clsx(className, "btn-active breadcrumbs-btn-active")}
itemProp="name"
>
{children}
Expand Down
5 changes: 3 additions & 2 deletions packages/theme-nonepress/src/theme/DocBreadcrumbs/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
@apply mb-2;

&-btn {
@apply btn btn-ghost btn-xs no-animation rounded-2xl !no-underline;
@apply rounded-2xl !no-underline;

&-active {
@apply btn-active text-primary;
@apply !bg-base-300 text-primary cursor-default;
@apply transition-[background-color] duration-500;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function DocVersionBadge({
className={clsx(
className,
ThemeClassNames.docs.docVersionBadge,
"doc-version-badge",
"badge badge-ghost doc-version-badge",
)}
>
<Translate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.doc-version-badge {
@apply badge badge-ghost font-semibold;
@apply font-semibold;
@apply transition-[color,background-color,border-color] duration-500;

&-container {
@apply mb-2;
Expand Down

0 comments on commit 72e5413

Please sign in to comment.