address review comments

Signed-off-by: Thomas Cooper <57812123+coopernetes@users.noreply.github.com>
This commit is contained in:
Thomas Cooper
2023-10-03 19:33:28 -04:00
parent 5ad5344756
commit 239ab25ebc
3 changed files with 3 additions and 38 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/theme': patch
---
Fixed a bug to support string fontSize values (`"2.5rem"`) instead of forcing numeric-only values & requiring casts. In addition, added an optional fontFamily prop for h1-h6 BackstageTypography variants to allow further customization.
Added support for string `fontSize` values (e.g. `"2.5rem"`) in themes in addition to numbers. Also added an optional `fontFamily` prop for header typography variants to allow further customization.
+1 -36
View File
@@ -178,42 +178,7 @@ export function createBaseThemeOptions<PaletteOptions>(
options: BaseThemeOptionsInput<PaletteOptions>,
): {
palette: PaletteOptions;
typography:
| BackstageTypography
| {
htmlFontSize: number;
fontFamily: string;
h1: {
fontSize: number;
fontWeight: number;
marginBottom: number;
};
h2: {
fontSize: number;
fontWeight: number;
marginBottom: number;
};
h3: {
fontSize: number;
fontWeight: number;
marginBottom: number;
};
h4: {
fontWeight: number;
fontSize: number;
marginBottom: number;
};
h5: {
fontWeight: number;
fontSize: number;
marginBottom: number;
};
h6: {
fontWeight: number;
fontSize: number;
marginBottom: number;
};
};
typography: BackstageTypography;
page: PageTheme;
getPageTheme: ({ themeId }: PageThemeSelector) => PageTheme;
};
@@ -57,7 +57,7 @@ export function createBaseThemeOptions<PaletteOptions>(
throw new Error(`${defaultPageTheme} is not defined in pageTheme.`);
}
const defaultTypography = {
const defaultTypography: BackstageTypography = {
htmlFontSize,
fontFamily,
h1: {