Skip to content

Commit d4c7ea4

Browse files
add sort (#1127)
1 parent e9301be commit d4c7ea4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/formats/cssAdvanced.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type {TransformedToken, FormatFn, FormatFnArguments, FormattingOptions} from 'style-dictionary/types'
22
import {format} from 'prettier'
3-
import {fileHeader, formattedVariables} from 'style-dictionary/utils'
3+
import {fileHeader, formattedVariables, sortByName} from 'style-dictionary/utils'
44

55
const wrapWithSelector = (css: string, selector: string | false): string => {
66
// return without selector
@@ -69,7 +69,7 @@ export const cssAdvanced: FormatFn = async ({
6969
// filter tokens to only include the ones that pass the matcher
7070
const filteredDictionary = {
7171
...dictionary,
72-
allTokens: dictionary.allTokens.filter(matcher || (() => true)),
72+
allTokens: dictionary.allTokens.filter(matcher || (() => true)).sort(sortByName),
7373
}
7474
// early abort if no matches
7575
if (!filteredDictionary.allTokens.length) continue

0 commit comments

Comments
 (0)