byuckchon-frontend-cli 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "byuckchon-frontend-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "byuckchon frontend CLI for creating React and Next.js projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -342,7 +342,7 @@ StyleDictionary.registerTransform({
342
342
  .toLowerCase(),
343
343
  });
344
344
 
345
- // Tailwind v4 @theme 변수 생성
345
+ // color는 Tailwind 유틸리티로, typography는 .text-* 클래스로 생성
346
346
  StyleDictionary.registerFormat({
347
347
  name: "css/tailwind-theme",
348
348
  format: ({ dictionary }) => {
@@ -357,23 +357,33 @@ StyleDictionary.registerFormat({
357
357
  if (token.$type === "color") {
358
358
  css += \` --color-\${token.name}: \${token.$value};\\n\`;
359
359
  }
360
+ });
361
+ css += "}\\n\\n";
362
+
363
+ css += "@layer components {\\n";
364
+ dictionary.allTokens.forEach((token) => {
360
365
  if (token.$type === "typography" && token.$value) {
361
366
  const typo = token.$value;
362
- if (typo.fontFamily) {
363
- css += \` --font-family-\${token.name}: \${typo.fontFamily};\\n\`;
364
- }
365
- if (typo.fontWeight) {
366
- css += \` --font-weight-\${token.name}: \${typo.fontWeight};\\n\`;
367
- }
367
+ css += \` .text-\${token.name} {\\n\`;
368
368
  if (typo.fontSize) {
369
- css += \` --font-size-\${token.name}: \${withPx(typo.fontSize)};\\n\`;
369
+ css += \` font-size: \${withPx(typo.fontSize)};\\n\`;
370
370
  }
371
371
  if (typo.lineHeight) {
372
- css += \` --line-height-\${token.name}: \${withPx(typo.lineHeight)};\\n\`;
372
+ css += \` line-height: \${withPx(typo.lineHeight)};\\n\`;
373
+ }
374
+ if (typo.letterSpacing) {
375
+ css += \` letter-spacing: \${typo.letterSpacing};\\n\`;
376
+ }
377
+ if (typo.fontWeight) {
378
+ css += \` font-weight: \${typo.fontWeight};\\n\`;
373
379
  }
380
+ if (typo.fontFamily) {
381
+ css += \` font-family: \${typo.fontFamily};\\n\`;
382
+ }
383
+ css += " }\\n";
374
384
  }
375
385
  });
376
- css += "}\\n\\n";
386
+ css += "}\\n";
377
387
 
378
388
  return css;
379
389
  },