From 84548ddbff9504ac862934296c253c1dd9ee0855 Mon Sep 17 00:00:00 2001 From: brandon-schabel Date: Sat, 21 Oct 2023 13:36:01 -0700 Subject: [PATCH] comment problem code --- modules/htmlody/generate-css.ts | 88 ++++++++++++++++----------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/modules/htmlody/generate-css.ts b/modules/htmlody/generate-css.ts index 0032749..d1e0d77 100644 --- a/modules/htmlody/generate-css.ts +++ b/modules/htmlody/generate-css.ts @@ -323,7 +323,7 @@ const bgColorGen = ( ); }; -const colorRes = bgColorGen("red", 500); +// const colorRes = bgColorGen("red", 500); const borderColorGen = ( color: Color, @@ -337,49 +337,49 @@ const borderColorGen = ( ); }; -const generateColorUtilities = < - ColorMapT extends ColorMap, - ColorKeys extends keyof ColorMapT = keyof ColorMapT, - ShadeKey extends keyof ColorMapT[ColorKeys] = keyof ColorMapT[ColorKeys], - Shade extends ColorMapT[ColorKeys][ShadeKey] = ColorMapT[ColorKeys][ShadeKey] ->( - colorMap: ColorMapT -) => { - let utilities = {}; - - const keys = Object.keys(colorMap) as ColorKeys[]; - for (let i = 0; keys.length; i++) { - const color = keys[i]; - - if (color in colorMap) { - const shades = Object.keys( - colorMap[color] - ) as (keyof ColorMapT[ColorKeys])[]; - for (let j = 0; j < shades.length; j++) { - const shade = shades[j]; - const value = colorMap[color][shade]; - if (typeof value === "string") { - // Make sure value is a string - utilities = { - ...utilities, - ...textColorGen(color, value), - ...bgColorGen(color, value), - ...borderColorGen(color, value), - }; - } - } - } - } - - return utilities as Record< - | keyof ReturnType> - | keyof ReturnType> - | keyof ReturnType>, - string - >; -}; - -const colorUtilities = generateColorUtilities(colorMap); +// const generateColorUtilities = < +// ColorMapT extends ColorMap, +// ColorKeys extends keyof ColorMapT = keyof ColorMapT, +// ShadeKey extends keyof ColorMapT[ColorKeys] = keyof ColorMapT[ColorKeys], +// Shade extends ColorMapT[ColorKeys][ShadeKey] = ColorMapT[ColorKeys][ShadeKey] +// >( +// colorMap: ColorMapT +// ) => { +// let utilities = {}; + +// const keys = Object.keys(colorMap) as ColorKeys[]; +// for (let i = 0; keys.length; i++) { +// const color = keys[i]; + +// if (color in colorMap) { +// const shades = Object.keys( +// colorMap[color] +// ) as (keyof ColorMapT[ColorKeys])[]; +// for (let j = 0; j < shades.length; j++) { +// const shade = shades[j]; +// const value = colorMap[color][shade]; +// if (typeof value === "string") { +// // Make sure value is a string +// utilities = { +// ...utilities, +// ...textColorGen(color, value), +// ...bgColorGen(color, value), +// ...borderColorGen(color, value), +// }; +// } +// } +// } +// } + +// return utilities as Record< +// | keyof ReturnType> +// | keyof ReturnType> +// | keyof ReturnType>, +// string +// >; +// }; + +// const colorUtilities = generateColorUtilities(colorMap); export const CSS_MAP = { ...spacingHelper(0.5, 0.125, "rem"),