Skip to content

Commit

Permalink
fix tokens page layout. Exclude contrast tokens from table.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyManetov committed Jul 23, 2024
1 parent 1a3fe02 commit 81ec744
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/docs/themes/implementation/useTokensDoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ function convertDocGroup(params: { docGroupCfgArr: TTokensDocGroupCfg[], tokens:
});
}

const excludedTokens = ['primary-contrast', 'secondary-contrast', 'accent-contrast', 'critical-contrast', 'info-contrast', 'success-contrast', 'warning-contrast', 'error-contrast'];

function convertDocItems(params: { docItemCfg: TTokensDocItemCfg, tokens: IThemeVarUI[] }): ITokensDocItem[] {
const CRITERIA = {
pathStartsWith: (str: string) => (tok: IThemeVarUI) => {
return tok.id.indexOf(str) === 0;
return tok.id.indexOf(str) === 0 && !excludedTokens.find((i) => tok.id.includes(i));
},
};
const condition = CRITERIA.pathStartsWith(params.docItemCfg);
Expand Down

0 comments on commit 81ec744

Please sign in to comment.