Skip to content

Commit 0ca2d6f

Browse files
committed
feat: use structure of hooks in config
1 parent a89cc66 commit 0ca2d6f

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/index.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { Dictionary, Config } from 'style-dictionary/types'
1+
import type { Dictionary } from 'style-dictionary/types/DesignToken'
2+
import type { Config } from 'style-dictionary/types/Config'
23
import type { SdTailwindConfigType, TailwindFormatObjType } from './types'
34
import {
45
addHyphen,
@@ -108,17 +109,19 @@ export const makeSdTailwindConfig = ({
108109

109110
return {
110111
source: getConfigValue(source, ['tokens/**/*.json']),
111-
format: {
112-
tailwindFormat: ({ dictionary }: { dictionary: Dictionary }) => {
113-
return getTailwindFormat({
114-
dictionary,
115-
formatType,
116-
isVariables,
117-
extend,
118-
prefix,
119-
type,
120-
tailwind
121-
})
112+
hooks: {
113+
formats: {
114+
tailwindFormat: ({ dictionary }: { dictionary: Dictionary }) => {
115+
return getTailwindFormat({
116+
dictionary,
117+
formatType,
118+
isVariables,
119+
extend,
120+
prefix,
121+
type,
122+
tailwind
123+
})
124+
}
122125
}
123126
},
124127
platforms: {

0 commit comments

Comments
 (0)