File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
packages/paste-website/src/components/tokens-list Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ const Content: React.FC<React.PropsWithChildren<BoxProps>> = (props) => (
4040const defaultTheme = "twilio" ;
4141const defaultFormat = "css" ;
4242
43+ const hiddenTokens = { "box-shadows" : [ "shadow" , "shadow-low" , "shadow-high" , "shadow-card" ] } ;
44+
4345const getTokenListByTheme = ( theme : Themes ) : Tokens => {
4446 let tokenList : Tokens = TwilioThemeTokens . tokens ;
4547
@@ -61,6 +63,19 @@ const getTokenListByTheme = (theme: Themes): Tokens => {
6163 tokenList = TwilioThemeTokens . tokens ;
6264 break ;
6365 }
66+
67+ // Remove hidden tokens from tokenList
68+ Object . keys ( hiddenTokens ) . forEach ( ( category ) => {
69+ const cat = category as keyof typeof hiddenTokens ;
70+ hiddenTokens [ cat ] . forEach ( ( token ) => {
71+ tokenList [ cat ] . forEach ( ( tokenObj ) => {
72+ if ( tokenObj . name === token ) {
73+ tokenList [ cat ] = tokenList [ cat ] . filter ( ( item ) => item . name !== token ) ;
74+ }
75+ } ) ;
76+ } ) ;
77+ } ) ;
78+
6479 return tokenList ;
6580} ;
6681
You can’t perform that action at this time.
0 commit comments