@loword/loword-design-system 0.0.9 → 0.0.10
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/dist/index.css +3 -0
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +25 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/utils/cn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AA+B7C,QAAA,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,WAElC,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/dist/utils/cn.js
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
-
import {
|
|
2
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
3
|
+
// 커스텀 타이포 유틸을 twMerge 그룹에 등록해, 프리셋과 className이 상충하면
|
|
4
|
+
// 뒤(className)가 이기게 함. (typography.css의 @utility 목록과 반드시 일치시킬 것)
|
|
5
|
+
const DISPLAY_SIZES = [
|
|
6
|
+
'10', '12', '14', '16', '18', '20', '24', '28', '30', '32', '36', '40', '64',
|
|
7
|
+
'80', '120',
|
|
8
|
+
].map((s) => `display${s}`);
|
|
9
|
+
const FONT_WEIGHTS = [
|
|
10
|
+
'light', 'regular', 'medium', 'semibold', 'bold', 'extrabold', 'black',
|
|
11
|
+
];
|
|
12
|
+
// spacing.css의 커스텀 값. theme.spacing에 넣으면 gap-*/p*-*/m*-* 전 prefix가 한 번에 잡힘.
|
|
13
|
+
const SPACING = [
|
|
14
|
+
'4xs', '3xs', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl',
|
|
15
|
+
];
|
|
16
|
+
const twMerge = extendTailwindMerge({
|
|
17
|
+
extend: {
|
|
18
|
+
theme: {
|
|
19
|
+
spacing: SPACING,
|
|
20
|
+
},
|
|
21
|
+
classGroups: {
|
|
22
|
+
'font-size': DISPLAY_SIZES,
|
|
23
|
+
'font-weight': FONT_WEIGHTS,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
3
27
|
const cn = (...inputs) => {
|
|
4
28
|
return twMerge(clsx(inputs));
|
|
5
29
|
};
|