Skip to content

Commit

Permalink
chore: cleanup log and update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
knownasilya committed Dec 10, 2021
1 parent 18f9a6d commit 5126e06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions examples/design-tokens/stylelint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ const designTokens = {
},
};

function tokens(keys) {
return keys.filter(key => designTokens[key]).map(key => `var(${key})`);
function tokens(keys, { prefix } = {}) {
const pre = prefix || '';
return keys
.filter(key => designTokens[pre + key])
.map(key => `var(${pre}${key})`);
}

let config = {
subsets: {
'font-size': ['0.25em', '0.5em', '0.75em', '1em'],
color: tokens(['--gray-0', '--gray-1']),
color: tokens(['gray-0', 'gray-1'], { prefix: '--' }),
},
};

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function checkValueAgainstSubset(
(node: ValueParserNode) => node.type === 'word'
);

console.log(words);
// console.log(words);

const valueNotInSubset = words.some((node: ValueParserNode) => {
return !subset.includes(node.value);
Expand Down

0 comments on commit 5126e06

Please sign in to comment.