Skip to content

Commit 7116847

Browse files
refactor: rename auto theme aliases
1 parent e15a46a commit 7116847

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/svg/generator.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { BadgeParams, ContributionCalendar, StreakStats, MonthlyStats } from '../../types';
22
import { getLabels, type BadgeLabels } from '../i18n/badgeLabels';
3-
import { AUTO_DARK_THEME, AUTO_LIGHT_THEME } from './themes';
3+
import { AUTO_THEME_DARK, AUTO_THEME_LIGHT } from './themes';
44
import { TOWER_ANIMATION_CSS } from './animations';
55
import { computeTowers, type TowerData } from './layout';
66
import { sanitizeFont, sanitizeHexColor, sanitizeRadius, sanitizeGoogleFontUrl } from './sanitizer';
@@ -237,8 +237,8 @@ function generateAutoThemeSVG(
237237
params: BadgeParams,
238238
calendar: ContributionCalendar
239239
): string {
240-
const light = AUTO_LIGHT_THEME;
241-
const dark = AUTO_DARK_THEME;
240+
const light = AUTO_THEME_LIGHT;
241+
const dark = AUTO_THEME_DARK;
242242
const safeUser = escapeXML(params.user || 'GitHub User');
243243
const sanitizedFont = sanitizeFont(params.font);
244244
const selectedFont = sanitizedFont
@@ -428,8 +428,8 @@ export function generateMonthlySVG(stats: MonthlyStats, params: BadgeParams): st
428428
}
429429

430430
function generateAutoThemeMonthlySVG(stats: MonthlyStats, params: BadgeParams): string {
431-
const light = AUTO_LIGHT_THEME;
432-
const dark = AUTO_DARK_THEME;
431+
const light = AUTO_THEME_LIGHT;
432+
const dark = AUTO_THEME_DARK;
433433
const safeUser = escapeXML(params.user || 'GitHub User');
434434
const sanitizeFont = (name: string) => name.replace(/[^a-zA-Z0-9\s-]/g, '').trim();
435435
const sanitizedFont = params.font ? sanitizeFont(params.font) : null;

lib/svg/themes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ export const themes: Record<string, BadgeTheme> = {
7272
// Auto-theme pairs: the SVG switches between these two palettes
7373
// using @media (prefers-color-scheme) so the badge adapts to the
7474
// viewer's OS-level light/dark setting without any JavaScript.
75-
export const AUTO_LIGHT_THEME: BadgeTheme = themes.light;
76-
export const AUTO_DARK_THEME: BadgeTheme = themes.dark;
75+
export const AUTO_THEME_LIGHT: BadgeTheme = themes.light;
76+
export const AUTO_THEME_DARK: BadgeTheme = themes.dark;

0 commit comments

Comments
 (0)