File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed
Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ const _SnakeGame = css``;
191191
192192const Board = css `
193193 background : repeating-conic-gradient (
194- ${ color ( "colors- primary-100" ) } 0 90deg ,
194+ ${ color ( "colors/ primary-100" ) } 0 90deg ,
195195 transparent 0 180deg
196196 )
197197 0 0 / 32px 32px ;
Original file line number Diff line number Diff line change @@ -3,22 +3,22 @@ import theme from "./theme";
33export const themeColors = theme . colors ;
44
55export const themeColorNameList = ( ( ) => {
6- const list : string [ ] = [ ] ;
6+ const set = new Set < string > ( ) ;
77
88 for ( const colorSet of [ themeColors , themeColors . light , themeColors . dark ] ) {
99 for ( const [ key , value ] of Object . entries ( colorSet ) ) {
10- if ( typeof value == "string" ) list . push ( key ) ;
10+ if ( typeof value == "string" ) set . add ( key ) ;
1111 }
1212 }
1313
14- return list ;
14+ return set ;
1515} ) ( ) ;
1616
1717export const themeColorList = ( ( ) => {
1818 const list : string [ ] = [ ] ;
1919
2020 for ( const colorSet of [ themeColors , themeColors . light , themeColors . dark ] ) {
21- for ( const [ key , value ] of Object . entries ( colorSet ) ) {
21+ for ( const value of Object . values ( colorSet ) ) {
2222 if ( typeof value == "string" ) list . push ( value ) ;
2323 }
2424 }
Original file line number Diff line number Diff line change @@ -38,8 +38,9 @@ export const _color = (value: string) => {
3838
3939 const important = rest . some ( ( v ) => v == "!important" ) ;
4040
41- if ( ! themeColorNameList . includes ( value ) ) {
41+ if ( ! themeColorNameList . has ( value ) ) {
4242 console . warn ( `color '${ value } ' was not found in the current color palette` ) ;
43+ console . log ( themeColorNameList ) ;
4344 console . trace ( ) ;
4445 }
4546
@@ -50,7 +51,7 @@ export const _color = (value: string) => {
5051type ColorTheme = "light" | "dark" ;
5152
5253export const _staticColor = ( value : string , theme : ColorTheme ) => {
53- if ( ! themeColorNameList . includes ( value ) ) {
54+ if ( ! themeColorNameList . has ( value ) ) {
5455 console . warn ( `color '${ value } ' was not found in the current color palette` ) ;
5556 console . trace ( ) ;
5657 return ;
Original file line number Diff line number Diff line change @@ -13,14 +13,13 @@ import {
1313 jumboText ,
1414 largeText ,
1515 primaryFontBold ,
16- smallText ,
1716 style ,
1817 subText ,
1918 textDefinitions ,
2019} from "~/style/commonStyle" ;
2120import { pxToRem } from "~/style/fluidSizeTS" ;
2221
23- const twColors = themeColorNameList
22+ const twColors = Array . from ( themeColorNameList . keys ( ) )
2423 . map ( normalizeColorName )
2524 . map ( ( color ) => `--color-${ color } : var(--color-${ color } );` )
2625 . join ( "\n" ) ;
You can’t perform that action at this time.
0 commit comments