Skip to content

Commit be7c2b2

Browse files
reset some changes
1 parent 2119289 commit be7c2b2

File tree

7 files changed

+3
-31
lines changed

7 files changed

+3
-31
lines changed

src/formats/cssAdvanced.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const cssAdvanced: FormatFn = async ({
7979
format: 'css',
8080
dictionary: filteredDictionary,
8181
// @ts-ignore
82-
outputReferences: true,
82+
outputReferences,
8383
formatting: mergedFormatting,
8484
usesDtcg,
8585
})
@@ -88,7 +88,6 @@ export const cssAdvanced: FormatFn = async ({
8888
// add css with or without query
8989
output.push(queryString ? `${queryString} { ${cssWithSelector} }` : cssWithSelector)
9090
}
91-
return output.join('\n')
9291
// return prettified
93-
// return await format(output.join('\n'), {parser: 'css', printWidth: 500})
92+
return await format(output.join('\n'), {parser: 'css', printWidth: 500})
9493
}

src/formats/utilities/createPropertyFormatterWithRef.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export default function createPropertyFormatterWithRef({
229229
}
230230
// console.log('originalValue:', originalValue, JSON.stringify(originalIsObject), ref)
231231

232-
const objectReplaceRegex = token.attributes.referenceMap
232+
const objectReplaceRegex = (value as string).match(/{/)
233233
? new RegExp(`{${ref.path.join('\\.')}(\\.\\$?value)?}`, 'g')
234234
: refVal
235235
// TODO: add test

src/platforms/css.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export const css: PlatformInitializer = (outputFile, prefix, buildPath, options)
3333
'dimension/rem',
3434
'duration/css',
3535
'shadow/css',
36-
'border/cssRefAttribute',
3736
'border/css',
3837
'typography/css',
3938
'fontFamily/css',

src/primerStyleDictionary.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import StyleDictionary from 'style-dictionary'
22
import {
33
borderToCss,
4-
borderToCssRefAttribute,
54
colorToRgbAlpha,
65
colorToHex,
76
colorToRgbaFloat,
@@ -150,8 +149,6 @@ PrimerStyleDictionary.registerTransform(shadowToCss)
150149

151150
PrimerStyleDictionary.registerTransform(borderToCss)
152151

153-
PrimerStyleDictionary.registerTransform(borderToCssRefAttribute)
154-
155152
PrimerStyleDictionary.registerTransform(typographyToCss)
156153

157154
PrimerStyleDictionary.registerTransform(fontWeightToNumber)

src/transformers/borderToCss.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,3 @@ export const borderToCss: Transform = {
4040
return `${value.width} ${value.style} ${value.color}`
4141
},
4242
}
43-
44-
/**
45-
*/
46-
export const borderToCssRefAttribute: Transform = {
47-
name: 'border/cssRefAttribute',
48-
type: 'attribute',
49-
filter: isBorder,
50-
transform: (_token: TransformedToken) => ({
51-
referenceMap: `[width] [style] [color]`,
52-
}),
53-
}

src/transformers/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export {borderToCss} from './borderToCss.js'
2-
export {borderToCssRefAttribute} from './borderToCss.js'
32
export {colorToHex} from './colorToHex.js'
43
export {colorToRgbAlpha} from './colorToRgbAlpha.js'
54
export {colorToRgbaFloat} from './colorToRgbaFloat.js'

src/transformers/shadowToCss.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,3 @@ export const shadowToCss: Transform = {
3737
.join(', ')
3838
},
3939
}
40-
41-
// /**
42-
// */
43-
// export const shadowToCssRefAttribute: Transform = {
44-
// name: 'shadow/cssRefAttribute',
45-
// type: 'attribute',
46-
// filter: isShadow,
47-
// transform: (_token: TransformedToken) => ({
48-
// referenceMap: `${shadow.inset === true ? 'inset ' : ''} [offsetX] [offsetY] [blur] [spread] [color]]`,
49-
// }),
50-
// }

0 commit comments

Comments
 (0)