Skip to content

Commit

Permalink
feat: Added buefy and buefy-dark themes
Browse files Browse the repository at this point in the history
  • Loading branch information
FajarKim committed Oct 13, 2023
1 parent ac074c4 commit ee416f6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import getData from "../src/getData";
import cardStyle from "../src/card";
import { themes } from "../../themes/index";
import { Themes } from "../../themes/index";

export type UiConfig = {
titleColor: string;
Expand All @@ -17,8 +17,8 @@ export default async function readmeStats(req: any, res: any): Promise<any> {
let username = req.query.username;

const fallbackTheme = "default";
const defaultTheme = themes[fallbackTheme];
const selectTheme = themes[req.query.theme] || defaultTheme;
const defaultTheme = Themes[fallbackTheme];
const selectTheme = Themes[req.query.theme] || defaultTheme;

let uiConfig: UiConfig = {
titleColor: req.query.title_color || selectTheme.title_color || defaultTheme.title_color,
Expand Down
6 changes: 5 additions & 1 deletion themes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Use `?theme=THEME_NAME` parameter like so :-
| `github_light` | ![image][github_light] |
| `whatsapp-light` | ![image][whatsapp-light] |
| `whatsapp-dark` | ![image][whatsapp-dark] |
| `buefy` | ![image][buefy] |
| `buefy-dark` | ![image][buefy-dark] |

Want to add a new theme? Consider reading the [contribution guidelines](/CONTRIBUTING.md#-themes-contribution) :D

Expand All @@ -44,4 +46,6 @@ Want to add a new theme? Consider reading the [contribution guidelines](/CONTRIB
[github_dark_dimmed]: https://github-readme-profile-theta.vercel.app/api?username=FajarKim&theme=github_dark_dimmed
[github_light]: https://github-readme-profile-theta.vercel.app/api?username=FajarKim&theme=github_light
[whatsapp-light]: https://github-readme-profile-theta.vercel.app/api?username=FajarKim&theme=whatsapp-light
[whatsapp-dark]: https://github-readme-profile-theta.vercel.app/api?username&theme=whatsapp-dark
[whatsapp-dark]: https://github-readme-profile-theta.vercel.app/api?username=FajarKim&theme=whatsapp-dark
[buefy]: https://github-readme-profile-theta.vercel.app/api?username=FajarKim&theme=buefy
[buefy-dark]: https://github-readme-profile-theta.vercel.app/api?username=FajarKim&theme=buefy-dark
27 changes: 26 additions & 1 deletion themes/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
export const themes = {
export type Themes = {
[key: string]: {
title_color?: string;
text_color?: string;
icon_color?: string;
border_color?: string;
bg_color?: string;
stroke_color?: string;
username_color?: string;
};
};

export const themes: Themes = {
default: {
title_color: "2f80ed",
text_color: "434d58",
Expand Down Expand Up @@ -107,4 +119,17 @@ export const themes = {
bg_color: "273741",
stroke_color: "008069",
},
buefy: {
title_color: "7957D5",
text_color: "363636",
icon_color: "FF3860",
border_color: "A8A8A8",
bg_color: "FFFFFF",
},
"buefy-dark": {
title_color: "7957D5",
text_color: "ABABAB",
icon_color: "FF3860",
bg_color: "1A1B27",
},
}

0 comments on commit ee416f6

Please sign in to comment.