From 45ae183cc9679c429930c79fdce921883faa5661 Mon Sep 17 00:00:00 2001 From: Muhammad Sammy Date: Wed, 24 Jun 2020 15:38:49 +0200 Subject: [PATCH] feat: generate font weight types --- src/generation/ClassesGenerator.ts | 1 + src/generation/_definitions.d.ts | 52 +++++++++++++++--------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/generation/ClassesGenerator.ts b/src/generation/ClassesGenerator.ts index ed7771c4..01255e1c 100644 --- a/src/generation/ClassesGenerator.ts +++ b/src/generation/ClassesGenerator.ts @@ -146,6 +146,7 @@ export class ClassesGenerator implements IClassesGenerator { ...defaultTypography, fontFamily: Object.keys(this.configScanner.themeConfig.fontFamily).map(value => 'font-' + value), fontSize: Object.keys(this.configScanner.themeConfig.fontSize).map(size => 'font-' + size), + fontWeight: Object.keys(this.configScanner.themeConfig.fontWeight).map(weight => 'font-' + weight), textColor: this.getGeneratedClassesWithColors('text'), }; diff --git a/src/generation/_definitions.d.ts b/src/generation/_definitions.d.ts index 536d5c9a..4e15a732 100644 --- a/src/generation/_definitions.d.ts +++ b/src/generation/_definitions.d.ts @@ -37,10 +37,10 @@ interface IThemeConfig extends IThemeProps { // TODO /* eslint-disable @typescript-eslint/no-explicit-any */ interface IThemeProps { - screens?: { + screens: { [key: string]: string; }; - colors?: { + colors: { [key: string]: string | { [key: string]: string }; }; spacing: { @@ -65,16 +65,16 @@ interface IThemeProps { backgroundColor?: any; borderColor?: any; container?: any; - cursor?: { + cursor: { [key: string]: string; }; - divideWidth?: { + divideWidth: { [key: string]: string; }; - fill?: { + fill: { [key: string]: string; }; - flex?: { + flex: { [key: string]: string; }; flexGrow: { @@ -89,37 +89,37 @@ interface IThemeProps { fontSize: { [key: string]: string; }; - fontWeight?: { + fontWeight: { [key: string]: string; }; height: any; - inset?: { + inset: { [key: string]: string; }; - letterSpacing?: { + letterSpacing: { [key: string]: string; }; - lineHeight?: { + lineHeight: { [key: string]: string; }; - listStyleType?: { + listStyleType: { [key: string]: string; }; margin: any; - maxHeight?: { + maxHeight: { [key: string]: string; }; maxWidth: any; - minHeight?: { + minHeight: { [key: string]: string; }; - minWidth?: { + minWidth: { [key: string]: string; }; - objectPosition?: { + objectPosition: { [key: string]: string; }; - opacity?: { + opacity: { [key: string]: string; }; order: { @@ -127,15 +127,15 @@ interface IThemeProps { }; padding: any; placeholderColor: any; - stroke?: { + stroke: { [key: string]: string; }; - strokeWidth?: { + strokeWidth: { [key: string]: string; }; textColor: any; width: any; - zIndex?: { + zIndex: { [key: string]: string; }; gap: any; @@ -164,26 +164,26 @@ interface IThemeProps { gridRowEnd: { [key: string]: string; }; - transformOrigin?: { + transformOrigin: { [key: string]: string; }; - scale?: { + scale: { [key: string]: string; }; - rotate?: { + rotate: { [key: string]: string; }; translate: any; - skew?: { + skew: { [key: string]: string; }; - transitionProperty?: { + transitionProperty: { [key: string]: string; }; - transitionTimingFunction?: { + transitionTimingFunction: { [key: string]: string; }; - transitionDuration?: { + transitionDuration: { [key: string]: string; }; }