UNPKG

react-pdf-builder

Version:
71 lines (70 loc) 2.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DarkThemeBuilder = void 0; const ThemeBuilder_1 = require("../ThemeBuilder"); const DarkColorScheme_1 = require("./DarkColorScheme"); const LightColorScheme_1 = require("../light/LightColorScheme"); const LightThemeBuilder_1 = require("../light/LightThemeBuilder"); class DarkThemeBuilder extends ThemeBuilder_1.ThemeBuilder { constructor() { super(DarkColorScheme_1.darkColorScheme); } doBuild(scale, colorScheme) { const lightTheme = new LightThemeBuilder_1.LightThemeBuilder().build({ scale, override: { colorScheme } }); const bodyBackgroundColor = colorScheme.greyscale.gray900; const bodyColor = colorScheme.greyscale.gray300; const linkColor = ThemeBuilder_1.ThemeBuilder.lighten(LightColorScheme_1.lightColorScheme.colors.blue, 0.4); const darkThemeOverride = { // === Color Scheme === === === === === === === === === === === colorScheme, _bodyBackgroundColor: bodyBackgroundColor, _bodyColor: bodyColor, // === Button === === === === === === === === === === === buttonProps: { linkColor, }, // === Card === === === === === === === === === === === cardBodyProps: { className: 'bg-gray900 border-gray700', }, cardHeaderProps: { className: 'bg-gray800 border-gray700', }, // === Link === === === === === === === === === === === linkProps: { style: { color: linkColor, }, }, // === Pages === === === === === === === === === === === pageProps: { className: 'text-gray300 bg-gray900', }, // === Signature === === === === === === === === === === === signatureProps: { className: 'border-gray300', }, // === Table === === === === === === === === === === === tableProps: { stripeOpacity: 0.3, borderColor: colorScheme.greyscale.gray300, stripeStyle: { backgroundColor: '#ffffff15' }, }, tableRowProps: { stripeOpacity: 0.3, }, tableCellProps: { swatchOpacity: 0.3, }, // === Typography === === === === === === === === === === === blockquoteProps: { className: 'border-gray200 bg-gray800', }, headingProps: { className: 'border-gray300', }, }; return ThemeBuilder_1.ThemeBuilder.overrideTheme(lightTheme, darkThemeOverride); } } exports.DarkThemeBuilder = DarkThemeBuilder;