add GitHub themes - #480
Merged
Merged
Conversation
Found while reviewing #457. 1. Dark themes rendered a near-white border. `dark_github` / `dark_github_repocard` had no `border_color` and fell back to the default theme's `e4e2e2`. Set GitHub's borders on all four new themes: `d1d9e0` light, `3d444d` dark. 2. Excluding `default` / `default_repocard` broke the theme picker. `Home.tsx` initializes to one of them and treats it as "emit no `theme=` param", so stage 3 opened with nothing selected and the theme-less URL became unreachable. 3. Paired themes were shown for the wrong card type. The picker now takes `isRepoCard` and lists only the matching variant, hiding duplicates while keeping each card type's `default` visible. 4. Theme README generator only knew the `default` pair, so the new themes would land in the wrong tables. 5. 3 and 4 share a rule, kept duplicated on purpose: which themes to advertise per card type is presentation, not rendering, so it stays out of core's API. Both copies carry `Keep in sync` comments pointing at each other. 6. Dead docs anchor left by the `Responsive Card Theme` ➡️ `Light and Dark Mode` rename. 7. Core gains one export: the `ThemeName` type, replacing the private duplicate `ThemeNames` in `cards/types.ts` and the `keyof typeof themes` casts in `color.ts` and the picker.
…gory (#464) Two places independently hardcoded the same "is this a repo or gist card?" check: - `Home.tsx`: which theme variant to default to - `Customize.tsx`: whether to offer "Show Owner?" Both now derive it from one map in `models/CardType.ts`: ```ts export const CardCategory = { REPO: "repo", USER: "user" } as const; export const CATEGORY_BY_CARD_TYPE: Record<CardType, CardCategory> = { ... }; ``` A new card type won't compile until it's categorised, instead of silently falling into the non-repo branch like the boolean did. It also leaves room for another category, if we ever need one that changes the data a card requires. Also: - `ThemeStage` takes `category` instead of `isRepoCard`. - `getDefaultTheme` / `onThemeChange` use core's `ThemeName` instead of `string`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is only the code part of #457.
Documentation from that PR will be merged later, as explained there.