feat: dark mode switch design token [internal]#2704
Conversation
|
✅ Preview for this PR (commit |
|
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. |
…ed dark mode support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f9d5b9b to
55fbd9f
Compare
|
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. |
barjin
left a comment
There was a problem hiding this comment.
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 !
There was a problem hiding this comment.
I believe none of the changes in this file are necessary
There was a problem hiding this comment.
It was failing in the CI pipeline for me. Will try to revert these changes and see how it goes.
There was a problem hiding this comment.
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.jsxand remap dark-mode CSS variables incustom.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-btnusage with a customGitButtoniframe 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
…bility and performance
|
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. |
| 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({ |
There was a problem hiding this comment.
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.


Replaces the hand-maintained dark mode colors with the shared
@apify/ui-librarybrand palette, so docs dark mode stays in sync with the rest of Apify's products. Dark tokens are injected viaRoot.jsx(light mode keeps its current pinned values, since theUI-librarylight 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-btnreplaced with a smallGitButtoniframe component for proper dark mode support.