From ecce10198c31f4af0710e90a34de804fec623c4a Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Wed, 5 Aug 2026 22:22:18 +0200 Subject: [PATCH 1/8] document light/dark params, add ligh&dark themes --- apps/frontend/src/pages/Home/stages/Theme.tsx | 3 + docs/advanced_documentation.md | 72 +++++++++++++++---- packages/core/src/themes/index.ts | 24 +++++++ 3 files changed, 85 insertions(+), 14 deletions(-) diff --git a/apps/frontend/src/pages/Home/stages/Theme.tsx b/apps/frontend/src/pages/Home/stages/Theme.tsx index 7d386b812cb91..471b9d3149c7a 100644 --- a/apps/frontend/src/pages/Home/stages/Theme.tsx +++ b/apps/frontend/src/pages/Home/stages/Theme.tsx @@ -10,6 +10,9 @@ import type { CardUrlBuilder } from "../../../models/CardUrl"; import { useTheme } from "../../../redux/selectors/themeSelectors"; const excludedThemes = [ + "default", + "default_repocard", + "github_dark", "merko", "blue-green", "gotham", diff --git a/docs/advanced_documentation.md b/docs/advanced_documentation.md index 01d2acb36f522..6a88fce15c56a 100644 --- a/docs/advanced_documentation.md +++ b/docs/advanced_documentation.md @@ -74,22 +74,24 @@ Use `&theme=THEME_NAME` parameter like so : #### All inbuilt themes -GitHub Stats Extended comes with several built-in themes (e.g. `dark`, `radical`, `merko`, `gruvbox`, `tokyonight`, `onedark`, `cobalt`, `synthwave`, `highcontrast`, `dracula`). +GitHub Stats Extended comes with several built-in themes (e.g. `radical`, `merko`, `gruvbox`, `tokyonight`, `onedark`, `cobalt`, `synthwave`, `highcontrast`, `dracula`). GitHub Stats Extended Themes +We recommend using `light_github` for light mode and `dark_github` for dark mode. These themes match GitHub's default light and dark themes, ensuring that your stats card looks consistent with the rest of your profile. For repository cards and gist cards we recommend using `light_github_repocard` and `dark_github_repocard`. + You can look at a preview for [all available themes](../packages/core/src/themes/README.md) or checkout the [theme config file](../packages/core/src/themes/index.ts). Please note that we paused the addition of new themes to decrease maintenance efforts; all pull requests related to new themes will be closed. -#### Responsive Card Theme +#### Light and Dark Mode [![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#responsive-card-theme#gh-dark-mode-only) [![Anurag's GitHub stats-Light](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/stats-organization/github-stats-extended#responsive-card-theme#gh-light-mode-only) -Since GitHub will re-upload the cards and serve them from their [CDN](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls), we can not infer the browser/GitHub theme on the server side. There are, however, four methods you can use to create dynamics themes on the client side. +There are several methods you can use to create dynamic themes on the client side. -##### Use GitHub's new media feature (recommended) +##### Use GitHub's media feature (recommended) -You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-19-specify-theme-context-for-images-in-markdown-beta/) in HTML to specify whether to display images for light or dark themes. This is done using the HTML `` element in combination with the `prefers-color-scheme` media feature. +You can use [GitHub's media feature](https://github.blog/changelog/2022-05-19-specify-theme-context-for-images-in-markdown-beta/) in HTML to specify which image to display in light or dark mode. This is done using the HTML `` element in combination with the `prefers-color-scheme` media feature. ```html @@ -117,9 +119,21 @@ You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-1 +##### Set light and dark mode in one card + +Use the `theme_light` and `theme_dark` or `*_light` / `*_dark` color parameters to embed both modes in a single card URL. See [Light & Dark Mode Parameters](#light--dark-mode-parameters) below for full details. The card will then display in light mode or dark mode based on your browser / operating system settings. + +This approach doesn't use any GitHub-specific features, so it works even when embedding the card outside of GitHub. Or on your GitHub sponsorship page, which doesn't support the other, GitHub-specific approaches. + +However, if a user chooses a GitHub theme different from their browser/OS setting, the card will not be able to detect this. Since GitHub re-uploads the cards and serves them from their [CDN](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls), we can not infer the GitHub theme with this approach, only the browser/OS theme. + +```md +![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=default&theme_dark=dark) +``` + ##### Use GitHub's theme context tag -You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user GitHub theme automatically. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme: +You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user's light/dark mode. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme: ```md [![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-dark-mode-only) @@ -164,6 +178,30 @@ You can use the `bg_color` parameter to make any of [the available themes](../pa +#### Light & Dark Mode Parameters + +You can use the `theme_light`, `theme_dark`, and `*_light` / `*_dark` color parameters to customize the look of your card for different modes. + +**Priority (lowest → highest):** + +- default theme +- `theme` +- `theme_light` / `theme_dark` +- general color parameters +- `*_light` / `*_dark` color parameters + +for example: + +```md +![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=default&theme_dark=dark) +``` + +You can mix different parameter types. For example, set a light theme and a dark theme, but choose a custom title color: + +```md +![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=default&theme_dark=dark&title_color=aabbcc) +``` + ### Customization You can customize the appearance of all your cards however you wish with URL parameters. @@ -172,17 +210,19 @@ You can customize the appearance of all your cards however you wish with URL par | Name | Description | Type | Default value | | --------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------- | -| `title_color` | Card's title color. | string (hex color) | `2f80ed` | -| `text_color` | Body text color. | string (hex color) | `434d58` | -| `icon_color` | Icons color if available. | string (hex color) | `4c71f2` | -| `border_color` | Card's border color. Does not apply when `hide_border` is enabled. | string (hex color) | `e4e2e2` | -| `bg_color` | Card's background color. | string (hex color or a gradient in the form of _angle,start,end_) | `fffefe` | +| `title_color`1 | Card's title color. | string (hex color) | `2f80ed` | +| `text_color`1 | Body text color. | string (hex color) | `434d58` | +| `icon_color`1 | Icons color if available. | string (hex color) | `4c71f2` | +| `border_color`1 | Card's border color. Does not apply when `hide_border` is enabled. | string (hex color) | `e4e2e2` | +| `bg_color`1 | Card's background color. | string (hex color or a gradient in the form of _angle,start,end_) | `fffefe` | | `hide_border` | Hides the card's border. | boolean | `false` | -| `theme` | Name of the theme, choose from [all available themes](../packages/core/src/themes/README.md). | enum | `default` | +| `theme`1 | Name of the theme, choose from [all available themes](../packages/core/src/themes/README.md). | enum | `default` | | `cache_seconds` | Sets the cache header manually (min: 21600, max: 86400). | integer | `21600` | | `locale` | Sets the language in the card, you can check full list of available locales [here](#available-locales). | enum | `en` | | `border_radius` | Corner rounding on the card. | number | `4.5` | +1: These parameters support light and dark mode. You can use `*_light` and `*_dark` variants to specify different values for light and dark mode. For example, `title_color_light` and `title_color_dark` will set the title color for light and dark mode respectively. + > [!WARNING] > We use caching to decrease the load on our servers (see ). Cards generated by [https://github-stats-extended.vercel.app/](https://github-stats-extended.vercel.app/frontend) are cached for a few hours or days, depending on server load. If you want the data on your cards to be updated more often you can [deploy your own instance](deploy.md) and set [environment variable](deploy.md#available-environment-variables) `CACHE_SECONDS` to a value of your choosing. Or you can use the [GitHub Action workflow](https://github.com/stats-organization/github-readme-stats-action). @@ -283,12 +323,14 @@ If we don't support your language, please consider contributing! You can find mo | `custom_title` | Sets a custom title for the card. | string | ` GitHub Stats` | | `text_bold` | Uses bold text. | boolean | `true` | | `disable_animations` | Disables all animations in the card. | boolean | `false` | -| `ring_color` | Color of the rank circle. | string (hex color) | `2f80ed` | +| `ring_color`1 | Color of the rank circle. | string (hex color) | `2f80ed` | | `number_format` | Switches between two available formats for displaying the card values: `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` | | `number_precision` | Enforce the number of digits after the decimal point for `short` number format. Must be an integer between 0 and 2. Will be ignored for `long` number format. | integer (0, 1 or 2) | `null` | | `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `reviews`, `discussions_started`, `discussions_answered`, `prs_merged` or `prs_merged_percentage`. And the following, which support the `repo` and `owner` filters: `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` or `issues_commented`). | string (comma-separated values) | `null` | | `commits_year` | Filters and counts only commits made in the specified year. | integer _(YYYY)_ | ` (one year to date)` | +1: This parameter supports light and dark mode. You can use `ring_color_light` and `ring_color_dark` to specify different colors for light and dark mode. + > [!WARNING] > Custom title should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) (i.e: `Anurag's GitHub Stats` should become `Anurag%27s%20GitHub%20Stats`). You can use [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically. @@ -414,13 +456,15 @@ You can customize the appearance and behavior of the top languages card using th | `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` | | `custom_title` | Sets a custom title for the card. | string | `Most Used Languages` | | `disable_animations` | Disables all animations in the card. | boolean | `false` | -| `prog_bar_bg_color` | Background color of the bars. (Applies only to `normal` layout.) | string (hex color) | `#ddd` | +| `prog_bar_bg_color`1 | Background color of the bars. (Applies only to `normal` layout.) | string (hex color) | `#ddd` | | `hide_progress` | Uses the compact layout option, hides percentages, and removes the bars. | boolean | `false` | | `hide_values` | Hides language percentages or bytes while keeping the progress bars or chart. | boolean | `false` | | `size_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `1` | | `count_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `0` | | `stats_format` | Switches between two available formats for language's stats `percentages` and `bytes`. | enum | `percentages` | +1: This parameter supports light and dark mode. You can use `prog_bar_bg_color_light` and `prog_bar_bg_color_dark` to specify different colors for light and dark mode. + > [!WARNING] > Language names and custom title should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) (i.e: `c++` should become `c%2B%2B`, `jupyter notebook` should become `jupyter%20notebook`, `Most Used Languages` should become `Most%20Used%20Languages`, etc.) You can use [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically. diff --git a/packages/core/src/themes/index.ts b/packages/core/src/themes/index.ts index 565cd3a9413f0..b432c1247cd13 100644 --- a/packages/core/src/themes/index.ts +++ b/packages/core/src/themes/index.ts @@ -23,6 +23,30 @@ export const themes = { text_color: "434d58", bg_color: "fffefe", }, + light_github: { + title_color: "0969da", + icon_color: "0969da", + text_color: "59636e", + bg_color: "ffffff", + }, + dark_github: { + title_color: "4493f8", + icon_color: "4493f8", + text_color: "9198a1", + bg_color: "0d1117", + }, + light_github_repocard: { + title_color: "0969da", + icon_color: "59636e", + text_color: "59636e", + bg_color: "ffffff", + }, + dark_github_repocard: { + title_color: "4493f8", + icon_color: "9198a1", + text_color: "9198a1", + bg_color: "0d1117", + }, transparent: { title_color: "006AFF", icon_color: "0579C3", From ba04189700ad6dfd91a4edd5b78843576249da1b Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Thu, 6 Aug 2026 22:02:46 +0200 Subject: [PATCH 2/8] pnpm format --- docs/advanced_documentation.md | 102 ++++++++++++++++----------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/docs/advanced_documentation.md b/docs/advanced_documentation.md index 6a88fce15c56a..a6209847329ad 100644 --- a/docs/advanced_documentation.md +++ b/docs/advanced_documentation.md @@ -208,18 +208,18 @@ You can customize the appearance of all your cards however you wish with URL par #### Common Options -| Name | Description | Type | Default value | -| --------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------- | -| `title_color`1 | Card's title color. | string (hex color) | `2f80ed` | -| `text_color`1 | Body text color. | string (hex color) | `434d58` | -| `icon_color`1 | Icons color if available. | string (hex color) | `4c71f2` | -| `border_color`1 | Card's border color. Does not apply when `hide_border` is enabled. | string (hex color) | `e4e2e2` | -| `bg_color`1 | Card's background color. | string (hex color or a gradient in the form of _angle,start,end_) | `fffefe` | -| `hide_border` | Hides the card's border. | boolean | `false` | -| `theme`1 | Name of the theme, choose from [all available themes](../packages/core/src/themes/README.md). | enum | `default` | -| `cache_seconds` | Sets the cache header manually (min: 21600, max: 86400). | integer | `21600` | -| `locale` | Sets the language in the card, you can check full list of available locales [here](#available-locales). | enum | `en` | -| `border_radius` | Corner rounding on the card. | number | `4.5` | +| Name | Description | Type | Default value | +| -------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------- | +| `title_color`1 | Card's title color. | string (hex color) | `2f80ed` | +| `text_color`1 | Body text color. | string (hex color) | `434d58` | +| `icon_color`1 | Icons color if available. | string (hex color) | `4c71f2` | +| `border_color`1 | Card's border color. Does not apply when `hide_border` is enabled. | string (hex color) | `e4e2e2` | +| `bg_color`1 | Card's background color. | string (hex color or a gradient in the form of _angle,start,end_) | `fffefe` | +| `hide_border` | Hides the card's border. | boolean | `false` | +| `theme`1 | Name of the theme, choose from [all available themes](../packages/core/src/themes/README.md). | enum | `default` | +| `cache_seconds` | Sets the cache header manually (min: 21600, max: 86400). | integer | `21600` | +| `locale` | Sets the language in the card, you can check full list of available locales [here](#available-locales). | enum | `en` | +| `border_radius` | Corner rounding on the card. | number | `4.5` | 1: These parameters support light and dark mode. You can use `*_light` and `*_dark` variants to specify different values for light and dark mode. For example, `title_color_light` and `title_color_dark` will set the title color for light and dark mode respectively. @@ -306,28 +306,28 @@ If we don't support your language, please consider contributing! You can find mo #### Stats Card Exclusive Options -| Name | Description | Type | Default value | -| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------------------------------- | -| `hide` | Hides the [specified items](#hiding-individual-stats) from stats. | string (comma-separated values) | `null` | -| `hide_title` | Hides the title of your stats card. | boolean | `false` | -| `card_width` | Sets the card's width manually. | number | `500px (approx.)` | -| `hide_rank` | Hides the rank and automatically resizes the card width. | boolean | `false` | -| `rank_icon` | Shows alternative rank icon (i.e. `github`, `percentile` or `default`). | enum | `default` | -| `show_icons` | Shows icons near all stats. | boolean | `false` | -| `include_all_commits` | Count total commits instead of just the current year commits. | boolean | `false` | -| `line_height` | Sets the line height between text. | integer | `25` | -| `exclude_repo` | Excludes specified repositories. Affects only the count for "Total Stars Earned". | string (comma-separated values) | `null` | -| `repo` | Count only stats from the specified repositories. Affects only [certain items](#filtering-by-repository-and-owner). | string (comma-separated values) | `null` | -| `owner` | Count only stats from the specified organizations or users. Affects only [certain items](#filtering-by-repository-and-owner). | string (comma-separated values) | `null` | -| `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` | -| `custom_title` | Sets a custom title for the card. | string | ` GitHub Stats` | -| `text_bold` | Uses bold text. | boolean | `true` | -| `disable_animations` | Disables all animations in the card. | boolean | `false` | -| `ring_color`1 | Color of the rank circle. | string (hex color) | `2f80ed` | -| `number_format` | Switches between two available formats for displaying the card values: `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` | -| `number_precision` | Enforce the number of digits after the decimal point for `short` number format. Must be an integer between 0 and 2. Will be ignored for `long` number format. | integer (0, 1 or 2) | `null` | -| `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `reviews`, `discussions_started`, `discussions_answered`, `prs_merged` or `prs_merged_percentage`. And the following, which support the `repo` and `owner` filters: `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` or `issues_commented`). | string (comma-separated values) | `null` | -| `commits_year` | Filters and counts only commits made in the specified year. | integer _(YYYY)_ | ` (one year to date)` | +| Name | Description | Type | Default value | +| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------------------------------- | +| `hide` | Hides the [specified items](#hiding-individual-stats) from stats. | string (comma-separated values) | `null` | +| `hide_title` | Hides the title of your stats card. | boolean | `false` | +| `card_width` | Sets the card's width manually. | number | `500px (approx.)` | +| `hide_rank` | Hides the rank and automatically resizes the card width. | boolean | `false` | +| `rank_icon` | Shows alternative rank icon (i.e. `github`, `percentile` or `default`). | enum | `default` | +| `show_icons` | Shows icons near all stats. | boolean | `false` | +| `include_all_commits` | Count total commits instead of just the current year commits. | boolean | `false` | +| `line_height` | Sets the line height between text. | integer | `25` | +| `exclude_repo` | Excludes specified repositories. Affects only the count for "Total Stars Earned". | string (comma-separated values) | `null` | +| `repo` | Count only stats from the specified repositories. Affects only [certain items](#filtering-by-repository-and-owner). | string (comma-separated values) | `null` | +| `owner` | Count only stats from the specified organizations or users. Affects only [certain items](#filtering-by-repository-and-owner). | string (comma-separated values) | `null` | +| `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` | +| `custom_title` | Sets a custom title for the card. | string | ` GitHub Stats` | +| `text_bold` | Uses bold text. | boolean | `true` | +| `disable_animations` | Disables all animations in the card. | boolean | `false` | +| `ring_color`1 | Color of the rank circle. | string (hex color) | `2f80ed` | +| `number_format` | Switches between two available formats for displaying the card values: `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` | +| `number_precision` | Enforce the number of digits after the decimal point for `short` number format. Must be an integer between 0 and 2. Will be ignored for `long` number format. | integer (0, 1 or 2) | `null` | +| `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `reviews`, `discussions_started`, `discussions_answered`, `prs_merged` or `prs_merged_percentage`. And the following, which support the `repo` and `owner` filters: `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` or `issues_commented`). | string (comma-separated values) | `null` | +| `commits_year` | Filters and counts only commits made in the specified year. | integer _(YYYY)_ | ` (one year to date)` | 1: This parameter supports light and dark mode. You can use `ring_color_light` and `ring_color_dark` to specify different colors for light and dark mode. @@ -445,23 +445,23 @@ Endpoint: `api/top-langs?username=anuraghazra` You can customize the appearance and behavior of the top languages card using the [common options](#common-options) and exclusive options listed in the table below. -| Name | Description | Type | Default value | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- | --------------------------------------------------- | -| `hide` | Hides the [specified languages](#hide-individual-languages) from card. | string (comma-separated values) | `null` | -| `hide_title` | Hides the title of your card. | boolean | `false` | -| `layout` | Switches between five available layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`. | enum | `normal` | -| `card_width` | Sets the card's width manually. | number | `300` | -| `langs_count` | Shows more languages on the card, between 1-20. | integer | `5` for `normal` and `donut`, `6` for other layouts | -| `exclude_repo` | Excludes specified repositories. | string (comma-separated values) | `null` | -| `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` | -| `custom_title` | Sets a custom title for the card. | string | `Most Used Languages` | -| `disable_animations` | Disables all animations in the card. | boolean | `false` | -| `prog_bar_bg_color`1 | Background color of the bars. (Applies only to `normal` layout.) | string (hex color) | `#ddd` | -| `hide_progress` | Uses the compact layout option, hides percentages, and removes the bars. | boolean | `false` | -| `hide_values` | Hides language percentages or bytes while keeping the progress bars or chart. | boolean | `false` | -| `size_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `1` | -| `count_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `0` | -| `stats_format` | Switches between two available formats for language's stats `percentages` and `bytes`. | enum | `percentages` | +| Name | Description | Type | Default value | +| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- | --------------------------------------------------- | +| `hide` | Hides the [specified languages](#hide-individual-languages) from card. | string (comma-separated values) | `null` | +| `hide_title` | Hides the title of your card. | boolean | `false` | +| `layout` | Switches between five available layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`. | enum | `normal` | +| `card_width` | Sets the card's width manually. | number | `300` | +| `langs_count` | Shows more languages on the card, between 1-20. | integer | `5` for `normal` and `donut`, `6` for other layouts | +| `exclude_repo` | Excludes specified repositories. | string (comma-separated values) | `null` | +| `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` | +| `custom_title` | Sets a custom title for the card. | string | `Most Used Languages` | +| `disable_animations` | Disables all animations in the card. | boolean | `false` | +| `prog_bar_bg_color`1 | Background color of the bars. (Applies only to `normal` layout.) | string (hex color) | `#ddd` | +| `hide_progress` | Uses the compact layout option, hides percentages, and removes the bars. | boolean | `false` | +| `hide_values` | Hides language percentages or bytes while keeping the progress bars or chart. | boolean | `false` | +| `size_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `1` | +| `count_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `0` | +| `stats_format` | Switches between two available formats for language's stats `percentages` and `bytes`. | enum | `percentages` | 1: This parameter supports light and dark mode. You can use `prog_bar_bg_color_light` and `prog_bar_bg_color_dark` to specify different colors for light and dark mode. From 100090de319d099deb54c403fd396f4d379875b8 Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Fri, 7 Aug 2026 10:45:36 +0200 Subject: [PATCH 3/8] use new themes and adaptive mode in docs, add missing light/dark sample section --- README.md | 56 ++++- docs/advanced_documentation.md | 376 ++++++++++++++++++++++++++------- docs/fork.md | 24 ++- 3 files changed, 374 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index 46f255235ced4..f596f96e43494 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,15 @@ GitHub Stats Extended Logo

GitHub Stats Extended

Dynamically generate GitHub stats for your READMEs.

- + + + + + + This project is the [extended, actively maintained successor](docs/fork.md) of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). It generates [various stats cards](#card-types), e.g. about your GitHub contributions, your top languages, etc. You can [customize](#advanced-customization) the cards via multiple parameters. @@ -45,23 +53,59 @@ GitHub-Stats-Extended aims to be fully compatible with github-readme-stats. For - Show your GitHub statistics: - ![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra) + + + Anurag's GitHub stats + - ...your top languages...: - ![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&langs_count=4) + + + Top Langs + - ...and development time: - [![Alan's WakaTime stats](https://github-stats-extended.vercel.app/api/wakatime?username=alan&langs_count=6)](https://wakatime.com/@alan) + + + + Alan's WakaTime stats + + - Pin more than 6 repos in your GitHub profile: - [![Readme Card](https://github-stats-extended.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats) + + + + Readme Card + + - Pin Gists in your GitHub profile: - [![Gist Card](https://github-stats-extended.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d)](https://gist.github.com/Yizack/bbfce31e0217a3689c8d961a356cb10d) + + + + Gist Card + + - Customize all the cards: diff --git a/docs/advanced_documentation.md b/docs/advanced_documentation.md index a6209847329ad..f92572e390f5e 100644 --- a/docs/advanced_documentation.md +++ b/docs/advanced_documentation.md @@ -84,8 +84,8 @@ You can look at a preview for [all available themes](../packages/core/src/themes #### Light and Dark Mode -[![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#responsive-card-theme#gh-dark-mode-only) -[![Anurag's GitHub stats-Light](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/stats-organization/github-stats-extended#responsive-card-theme#gh-light-mode-only) +[![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark_github#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#responsive-card-theme#gh-dark-mode-only) +[![Anurag's GitHub stats-Light](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=light_github#gh-light-mode-only)](https://github.com/stats-organization/github-stats-extended#responsive-card-theme#gh-light-mode-only) There are several methods you can use to create dynamic themes on the client side. @@ -97,11 +97,11 @@ You can use [GitHub's media feature](https://github.blog/changelog/2022-05-19-sp ```html - + ``` @@ -110,11 +110,11 @@ You can use [GitHub's media feature](https://github.blog/changelog/2022-05-19-sp - + @@ -128,23 +128,30 @@ This approach doesn't use any GitHub-specific features, so it works even when em However, if a user chooses a GitHub theme different from their browser/OS setting, the card will not be able to detect this. Since GitHub re-uploads the cards and serves them from their [CDN](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls), we can not infer the GitHub theme with this approach, only the browser/OS theme. ```md -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=default&theme_dark=dark) +![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=light_github&theme_dark=dark_github) ``` +
+:eyes: Show example + +![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=light_github&theme_dark=dark_github) + +
+ ##### Use GitHub's theme context tag You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user's light/dark mode. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme: ```md -[![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-dark-mode-only) -[![Anurag's GitHub stats-Light](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-light-mode-only) +[![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark_github#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-dark-mode-only) +[![Anurag's GitHub stats-Light](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=light_github#gh-light-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-light-mode-only) ```
:eyes: Show example -[![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-dark-mode-only) -[![Anurag's GitHub stats-Light](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-light-mode-only) +[![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark_github#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-dark-mode-only) +[![Anurag's GitHub stats-Light](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=light_github#gh-light-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-light-mode-only)
@@ -193,13 +200,13 @@ You can use the `theme_light`, `theme_dark`, and `*_light` / `*_dark` color para for example: ```md -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=default&theme_dark=dark) +![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=light_github&theme_dark=dark_github) ``` You can mix different parameter types. For example, set a light theme and a dark theme, but choose a custom title color: ```md -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=default&theme_dark=dark&title_color=aabbcc) +![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=light_github&theme_dark=dark_github&title_color=aabbcc) ``` ### Customization @@ -373,19 +380,43 @@ You can customize the appearance and behavior of the pinned repository card usin ### Demo -![Readme Card](https://github-stats-extended.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats) + + + Readme Card + Use [show\_owner](#options) query option to include the repo's owner username: -![Readme Card](https://github-stats-extended.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&show_owner=true) + + + Readme Card + Use [show](#options) query option to display the user's contributions to the repository: -![Readme Card](https://github-stats-extended.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented) + + + Readme Card + You can also specify the `repo` parameter in the form `/` to pin a repository from any user or organization, not just your own. This allows you to showcase repositories you contributed to, regardless of ownership. -![Readme Card](https://github-stats-extended.vercel.app/api/pin/?username=anuraghazra&repo=statykjs/statyk&show_owner=true&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented) + + + Readme Card + ## GitHub Gist Pins @@ -412,11 +443,23 @@ You can customize the appearance and behavior of the gist card using the [common ### Demo -![Gist Card](https://github-stats-extended.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d) + + + Gist Card + Use [show\_owner](#options-1) query option to include the gist's owner username -![Gist Card](https://github-stats-extended.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d&show_owner=true) + + + Gist Card + ## Top Languages Card @@ -567,31 +610,83 @@ You can use the `&stats_format=bytes` option to display the stats in bytes inste ### Demo -![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra) + + + Top Langs + #### Compact layout -![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&layout=compact) + + + Top Langs + #### Donut Chart layout -[![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&layout=donut)](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&layout=donut) + + + + Top Langs + + #### Donut Vertical Chart layout -[![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&layout=donut-vertical)](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&layout=donut-vertical) + + + + Top Langs + + #### Pie Chart layout -[![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&layout=pie)](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&layout=pie) + + + + Top Langs + + #### Hidden progress bars -[![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&hide_progress=true)](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&hide_progress=true) + + + + Top Langs + + #### Display bytes instead of percentage -[![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&stats_format=bytes)](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&stats_format=bytes) + + + + Top Langs + + ## WakaTime Stats Card @@ -630,13 +725,31 @@ You can customize the appearance and behavior of the WakaTime stats card using t ### Demo -![Alan's WakaTime stats](https://github-stats-extended.vercel.app/api/wakatime?username=alan) + + + Alan's WakaTime stats + -![Alan's WakaTime stats](https://github-stats-extended.vercel.app/api/wakatime?username=alan&card_width=315&hide_progress=true) + + + Alan's WakaTime stats + #### Compact layout -![Alan's WakaTime stats](https://github-stats-extended.vercel.app/api/wakatime?username=alan&layout=compact) + + + Alan's WakaTime stats + --- @@ -644,43 +757,103 @@ You can customize the appearance and behavior of the WakaTime stats card using t ### Default -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra) + + + Anurag's GitHub stats + ### Hiding specific stats -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&hide=contribs,issues) + + + Anurag's GitHub stats + ### Showing additional stats -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage,prs_commented,prs_reviewed,issues_commented) + + + Anurag's GitHub stats + ### Showing stats for a specific repository -![Anurag's GitHub stats for anuraghazra/github-readme-stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&repo=anuraghazra/github-readme-stats&hide=prs,issues,stars,commits,contribs&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented&hide_rank=true&custom_title=Anurag%27s%20Stats%20for%20github-readme-stats&card_width=370) + + + Anurag's GitHub stats for anuraghazra/github-readme-stats + ### Showing stats for a specific organization -![Anurag's GitHub stats for razorpay](https://github-stats-extended.vercel.app/api?username=anuraghazra&owner=razorpay&hide=prs,issues,stars,commits,contribs&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented&hide_rank=true&custom_title=Anurag%27s%20Stats%20for%20razorpay&card_width=370) + + + Anurag's GitHub stats for razorpay + ### Showing icons -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&hide=issues&show_icons=true) + + + Anurag's GitHub stats + ### Shows GitHub logo instead rank level -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&rank_icon=github) + + + Anurag's GitHub stats + ### Shows user rank percentile instead of rank level -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&rank_icon=percentile) + + + Anurag's GitHub stats + ### Customize Border Color -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&border_color=2e4058) + + + Anurag's GitHub stats + ### Include All Commits -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&include_all_commits=true) + + + Anurag's GitHub stats + ### Themes @@ -698,7 +871,13 @@ Choose from any of the [default themes](#themes) ### Setting card locale -![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api/?username=anuraghazra&locale=es) + + + Anurag's GitHub stats + ### Customizing repo card @@ -706,7 +885,13 @@ Choose from any of the [default themes](#themes) ### Gist card -![Gist Card](https://github-stats-extended.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d) + + + Gist Card + ### Customizing gist card @@ -714,11 +899,23 @@ Choose from any of the [default themes](#themes) ### Top languages -![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra) + + + Top Langs + ### WakaTime card -![Alan's WakaTime stats](https://github-stats-extended.vercel.app/api/wakatime?username=alan) + + + Alan's WakaTime stats + --- @@ -731,18 +928,22 @@ By default, GitHub does not lay out the cards side by side. To do that, you can ```html - + + + + - + + + + ``` @@ -750,36 +951,53 @@ By default, GitHub does not lay out the cards side by side. To do that, you can :eyes: Show example - + + + + - + + + + ### Pinning repositories + ```html - + + + + - + + + + ``` @@ -787,10 +1005,22 @@ By default, GitHub does not lay out the cards side by side. To do that, you can :eyes: Show example - + + + + - + + + + diff --git a/docs/fork.md b/docs/fork.md index 145a3f2e929c3..8043c5a3fd1e7 100644 --- a/docs/fork.md +++ b/docs/fork.md @@ -34,7 +34,13 @@ GitHub-Stats-Extended fetches up to 1000 of your starred repositories to accurat GitHub-Stats-Extended allows you to display your top languages without any numbers via the `hide_values` parameter. And the `prog_bar_bg_color` parameter allows you to customize the background color of the progress bars, e.g. by setting it to white: -![anuraghazra's top languages without numbers](https://github-stats-extended.vercel.app/api/top-langs?username=anuraghazra&langs_count=4&hide_values=true&prog_bar_bg_color=fff) + + + anuraghazra's top languages without numbers + ### Private contributions support @@ -52,7 +58,13 @@ See [here](advanced_documentation.md#filtering-by-repository-and-owner) for full anuraghazra's contributions to github-readme-stats: -![anuraghazra's contributions to github-readme-stats](https://github-stats-extended.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented) + + + anuraghazra's contributions to github-readme-stats + Add `&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented` to your repo card url to display your contributions to the pinned repository. @@ -60,7 +72,13 @@ Add `&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commen anurag's contributions to razorpay: -![anurag's contributions to razorpay](https://github-stats-extended.vercel.app/api?username=anuraghazra&owner=razorpay&hide=prs,issues,stars,commits,contribs&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented&hide_rank=true&custom_title=anurag%27s%20contributions%20to%20razorpay&card_width=333) + + + anurag's contributions to razorpay + Add `&repo=userA/repoA,orgB/repoB` or `&owner=userC,orgD` to your profile stats url to filter your contributions by repo or organization. (The screenshot above uses further customization options.) From fbc030f475cd64acadd1008ecfa67be043de2bd9 Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Fri, 7 Aug 2026 11:38:38 +0200 Subject: [PATCH 4/8] add more documentation --- docs/advanced_documentation.md | 4 ++-- docs/fork.md | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/advanced_documentation.md b/docs/advanced_documentation.md index f92572e390f5e..0792ec46bc574 100644 --- a/docs/advanced_documentation.md +++ b/docs/advanced_documentation.md @@ -78,7 +78,7 @@ GitHub Stats Extended comes with several built-in themes (e.g. `radical`, `merko GitHub Stats Extended Themes -We recommend using `light_github` for light mode and `dark_github` for dark mode. These themes match GitHub's default light and dark themes, ensuring that your stats card looks consistent with the rest of your profile. For repository cards and gist cards we recommend using `light_github_repocard` and `dark_github_repocard`. +We recommend using `light_github` for light mode and `dark_github` for dark mode. These themes match GitHub's default light and dark themes, ensuring that your stats card looks consistent with the rest of your profile. For repository cards and gist cards we recommend using `light_github_repocard` and `dark_github_repocard`, which use a different icon color. You can look at a preview for [all available themes](../packages/core/src/themes/README.md) or checkout the [theme config file](../packages/core/src/themes/index.ts). Please note that we paused the addition of new themes to decrease maintenance efforts; all pull requests related to new themes will be closed. @@ -125,7 +125,7 @@ Use the `theme_light` and `theme_dark` or `*_light` / `*_dark` color parameters This approach doesn't use any GitHub-specific features, so it works even when embedding the card outside of GitHub. Or on your GitHub sponsorship page, which doesn't support the other, GitHub-specific approaches. -However, if a user chooses a GitHub theme different from their browser/OS setting, the card will not be able to detect this. Since GitHub re-uploads the cards and serves them from their [CDN](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls), we can not infer the GitHub theme with this approach, only the browser/OS theme. +However, unlike with the "media" feature or the theme context tag, if a user chooses a GitHub theme different from their browser/OS setting, the card will not be able to detect this. Since GitHub re-uploads the cards and serves them from their [CDN](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls), we can not infer the GitHub theme with this approach, only the browser/OS theme. ```md ![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme_light=light_github&theme_dark=dark_github) diff --git a/docs/fork.md b/docs/fork.md index 8043c5a3fd1e7..7c54556014e2c 100644 --- a/docs/fork.md +++ b/docs/fork.md @@ -30,6 +30,20 @@ GitHub-Stats-Extended proactively precomputes and caches cards. This solves the GitHub-Stats-Extended fetches up to 1000 of your starred repositories to accurately compute your stars count. In github-readme-stats, this is limited to 100 repos because github-readme-stats doesn't have the above-mentioned performance improvements. +### Light and dark mode in a single card URL + +GitHub-Stats-Extended adds `theme_light`, `theme_dark`, and `*_light` / `*_dark` color parameter variants (e.g. `title_color_light`, `title_color_dark`) that let you embed both light and dark mode in a single card URL. The card will automatically switch between the two based on the viewer's browser or OS theme setting. + +```md +![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra&theme_light=light_github&theme_dark=dark_github) +``` + +This approach works on any platform, not just GitHub - and on GitHub sponsorship pages, which don't support the other approaches to light/dark theming. See [Set light and dark mode in one card](advanced_documentation.md#set-light-and-dark-mode-in-one-card) for full documentation. + +### GitHub-themed light and dark themes + +GitHub-Stats-Extended adds `light_github` and `dark_github` [themes](../packages/core/src/themes/README.md) that exactly match GitHub's default light and dark UI colors. For repo and gist cards, use `light_github_repocard` and `dark_github_repocard` instead, which use a different icon color. + ### Customization of top languages card GitHub-Stats-Extended allows you to display your top languages without any numbers via the `hide_values` parameter. And the `prog_bar_bg_color` parameter allows you to customize the background color of the progress bars, e.g. by setting it to white: From ad1049581007dd71f25f1271e78caa20487d928b Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Fri, 7 Aug 2026 12:22:46 +0200 Subject: [PATCH 5/8] docs: revert unnecessary change --- docs/advanced_documentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced_documentation.md b/docs/advanced_documentation.md index 0792ec46bc574..e8ffe4d1cb915 100644 --- a/docs/advanced_documentation.md +++ b/docs/advanced_documentation.md @@ -140,7 +140,7 @@ However, unlike with the "media" feature or the theme context tag, if a user cho ##### Use GitHub's theme context tag -You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user's light/dark mode. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme: +You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user's GitHub theme. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme: ```md [![Anurag's GitHub stats-Dark](https://github-stats-extended.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark_github#gh-dark-mode-only)](https://github.com/stats-organization/github-stats-extended#gh-dark-mode-only) From 34d08882a7613d300039739d578a30f42357faff Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti <24919330+marcalexiei@users.noreply.github.com> Date: Sat, 8 Aug 2026 20:32:42 +0200 Subject: [PATCH 6/8] fix: refinements and bugfixes for new themes (#462) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- apps/frontend/src/pages/Home/Home.tsx | 1 + apps/frontend/src/pages/Home/stages/Theme.tsx | 33 ++++- docs/advanced_documentation.md | 4 +- .../core/scripts/generate-theme-readme.js | 20 ++- packages/core/src/cards/types.ts | 5 +- packages/core/src/common/color.ts | 3 +- packages/core/src/index.ts | 1 + packages/core/src/themes/README.md | 118 ++++++++++-------- packages/core/src/themes/index.ts | 9 ++ 9 files changed, 125 insertions(+), 69 deletions(-) diff --git a/apps/frontend/src/pages/Home/Home.tsx b/apps/frontend/src/pages/Home/Home.tsx index 7c22adef91d09..9dcde4eabceb0 100644 --- a/apps/frontend/src/pages/Home/Home.tsx +++ b/apps/frontend/src/pages/Home/Home.tsx @@ -252,6 +252,7 @@ export function HomeScreen({ stage, setStage }: HomeScreenProps): JSX.Element { { setTheme(theme); setStage(4); diff --git a/apps/frontend/src/pages/Home/stages/Theme.tsx b/apps/frontend/src/pages/Home/stages/Theme.tsx index 471b9d3149c7a..638a8f63a6d25 100644 --- a/apps/frontend/src/pages/Home/stages/Theme.tsx +++ b/apps/frontend/src/pages/Home/stages/Theme.tsx @@ -1,3 +1,4 @@ +import type { ThemeName } from "@stats-organization/github-readme-stats-core"; import { themes } from "@stats-organization/github-readme-stats-core"; import type { JSX } from "react"; @@ -10,8 +11,6 @@ import type { CardUrlBuilder } from "../../../models/CardUrl"; import { useTheme } from "../../../redux/selectors/themeSelectors"; const excludedThemes = [ - "default", - "default_repocard", "github_dark", "merko", "blue-green", @@ -21,29 +20,51 @@ const excludedThemes = [ "holi", ]; +const allThemeNames = Object.keys(themes) as Array; + // Light themes first, adaptive themes in the middle, dark themes last. -const themeList = Object.keys(themes) - .filter((myTheme) => !excludedThemes.includes(myTheme)) - .sort((a, b) => getThemeSortRank(a) - getThemeSortRank(b)); +const forPicker = (names: ReadonlyArray) => + names + .filter((name) => !excludedThemes.includes(name)) + .sort((a, b) => getThemeSortRank(a) - getThemeSortRank(b)); + +// Some themes come in pairs: `X_repocard` for the repo and gist cards, `X` for +// the stats, top languages and WakaTime cards. Each side offers only its own +// variant, so the theme Home.tsx starts on is always one of the entries here. +// +// Keep in sync with `generateTable` in `packages/core/scripts/generate-theme-readme.js`, +// which splits the theme README tables by the same rule. +const repoCardThemes = forPicker( + allThemeNames.filter( + (name) => !allThemeNames.includes(`${name}_repocard` as ThemeName), + ), +); + +const nonRepoCardThemes = forPicker( + allThemeNames.filter((name) => !name.endsWith("_repocard")), +); interface ThemeStageProps { card: CardUrlBuilder; theme: string; + isRepoCard: boolean; onThemeChange: (theme: string) => void; } export function ThemeStage({ theme, card, + isRepoCard, onThemeChange, }: ThemeStageProps): JSX.Element { const { isDark } = useTheme(); + const themeList = isRepoCard ? repoCardThemes : nonRepoCardThemes; return ( <>
{themeList.map((myTheme) => { - const themeColors = themes[myTheme as keyof typeof themes]; + const themeColors = themes[myTheme]; return (