Skip to content

feat: dark mode switch design token [internal]#2704

Open
birosrichard wants to merge 16 commits into
masterfrom
feat/dark-mode-update
Open

feat: dark mode switch design token [internal]#2704
birosrichard wants to merge 16 commits into
masterfrom
feat/dark-mode-update

Conversation

@birosrichard

@birosrichard birosrichard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Replaces the hand-maintained dark mode colors with the shared @apify/ui-library brand palette, so docs dark mode stays in sync with the rest of Apify's products. Dark tokens are injected via Root.jsx (light mode keeps its current pinned values, since the UI-library light set shifts the palette and has a broken card hover color.

Along the way: dark theme variants for Academy and landing page SVGs, card components switched to the shared tokens, and react-github-btn replaced with a small GitButton iframe component for proper dark mode support.

@apify-service-account

apify-service-account commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

✅ Preview for this PR (commit 266213e9) is ready at https://pr-2704.preview.docs.apify.com (see action run).

@birosrichard birosrichard marked this pull request as ready for review July 7, 2026 12:59
@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@birosrichard birosrichard marked this pull request as draft July 7, 2026 12:59
@birosrichard birosrichard force-pushed the feat/dark-mode-update branch from f9d5b9b to 55fbd9f Compare July 7, 2026 19:07
@birosrichard birosrichard linked an issue Jul 7, 2026 that may be closed by this pull request
@birosrichard birosrichard marked this pull request as ready for review July 8, 2026 08:55
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@birosrichard birosrichard self-assigned this Jul 8, 2026
@birosrichard birosrichard added the t-web Issues with this label are in the ownership of the web team. label Jul 8, 2026
@birosrichard birosrichard changed the title feat: dark mode switch design token feat: dark mode switch design token [internal] Jul 8, 2026

@barjin barjin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous, more muted dark mode colors were honestly a bit easier to read for me. Anyway, the changes seem fine to me code-wise 👍 Thanks @birosrichard !

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe none of the changes in this file are necessary

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was failing in the CI pipeline for me. Will try to revert these changes and see how it goes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns the docs site’s dark mode with the shared @apify/ui-library brand palette by injecting UI-library dark design tokens at the theme root, and then refactoring key UI components/assets to consume those tokens consistently.

Changes:

  • Inject UI-library dark brand tokens via apify-docs-theme/src/theme/Root.jsx and remap dark-mode CSS variables in custom.css.
  • Update card components/styles to use shared token variables (including hover states) and add dark variants of Academy/landing SVG assets.
  • Replace react-github-btn usage with a custom GitButton iframe component to better support dark mode.

Reviewed changes

Copilot reviewed 18 out of 29 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tsconfig.json Adds Docusaurus module type aliases to TS configuration.
static/img/landing-pages/cli_dark.svg Updates dark landing SVG colors/defs to match new dark palette.
static/img/landing-pages/api_dark.svg Updates dark landing SVG colors/defs to match new dark palette.
static/img/academy/scraping-basics-python-dark.svg Adds dark-mode Academy course image asset.
static/img/academy/scraping-basics-javascript-dark.svg Adds dark-mode Academy course image asset.
static/img/academy/api-scraping-dark.svg Adds dark-mode Academy course image asset.
src/pages/index.tsx Adjusts homepage banner styling for dark mode tokenized background.
src/components/SdkSection/SdkSection.tsx Replaces GitHub star button with new GitButton component.
src/components/PlainCard/PlainCard.tsx Applies shared hover/token styling via styled VerticalTile.
src/components/OpenSourceCards/styles.module.css Switches hard-coded colors to shared token variables.
src/components/OpenSourceCards/OpenSourceCards.tsx Replaces react-github-btn with GitButton across cards.
src/components/GitButton.tsx Implements GitButton as a themed iframe using Docusaurus color mode.
src/components/CardWithIcon/CardWithIcon.tsx Applies shared hover/token styling via styled VerticalTile.
src/components/Cards.module.css Updates card hover/background/border behavior to use shared tokens in dark mode.
src/components/cardHoverStyles.ts Introduces shared hover CSS snippet for card-like tiles.
src/components/Card.jsx Simplifies dark-mode detection by using colorMode directly.
src/components/ActorTemplates/ActorTemplates.tsx Forces Actor template card styling to shared token colors, including hover.
src/components/ActionCard/ActionCard.tsx Applies shared hover styling and attempts to theme the arrow icon.
sources/academy/index.mdx Passes dark-mode image URLs to Academy cards.
sources/academy/homepage_content.json Adds imageUrlDarkTheme entries for Academy homepage cards.
sources/academy/build-and-publish/apify-store-basics/actor_description_seo_description.md Updates admonitions to include titles and tweaks formatting.
package.json Bumps @apify/ui-library and removes GitHub button dependencies.
apify-docs-theme/src/theme/Root.jsx Adds theme root wrapper that injects UI-library dark token CSS variables.
apify-docs-theme/src/theme/custom.css Refactors dark-mode CSS variables to reference injected token set and keeps pinned light tokens.
apify-docs-theme/package.json Bumps theme package @apify/ui-library dependency to match root.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread src/components/cardHoverStyles.ts
Comment thread src/components/Cards.module.css Outdated
Comment thread src/components/OpenSourceCards/styles.module.css
Comment thread src/components/ActorTemplates/ActorTemplates.tsx
Comment thread src/components/ActionCard/ActionCard.tsx
Comment thread src/components/GitButton.tsx

@webrdaniel webrdaniel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 check the Copilot comments, the one about the iframe looks relevant

nit: the icons look a bit blueish

Image

@yeinn1000

Copy link
Copy Markdown

Thank you richard! I like it in general
Can you check those small cards' interaction?
Screenshot 2026-07-08 at 12 52 56

@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@birosrichard birosrichard requested a review from TC-MO July 8, 2026 13:03
const { colorMode } = useColorMode();
return <GitHubButton data-color-scheme={colorMode} {...props} />;
// unauthenticated GitHub API requests (60/hr) can throttle star counts — replace iframe with a direct GitHub API call + server-side token to fix
const src = `https://buttons.github.io/buttons.html#${new URLSearchParams({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: This solution unfortunately proved not to be super reliable. It caused this issue on our web out of the blue, so I decided to replace it with a custom one. The width and height don't match precisely, so I'd say we're potentially risking the same issue here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-web Issues with this label are in the ownership of the web team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update dark theme colors

7 participants