@bobbykim/manguito-theme 0.1.2 → 0.1.3
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 +2 -2
- package/theme/generateClass.ts +4 -1
- package/theme/theme.ts +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/manguito-theme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "main theme file for manguito components library. Other MCL components will need to import this file to run.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"url": "https://github.com/bobbykim89/manguito-component-library.git"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "4e6b9b908a17893f6e6baab01741dc0dde771ac8"
|
|
21
21
|
}
|
package/theme/generateClass.ts
CHANGED
|
@@ -45,6 +45,7 @@ export type ClassType =
|
|
|
45
45
|
| 'BGOPACITY'
|
|
46
46
|
| 'OPACITY'
|
|
47
47
|
| 'MARGINB'
|
|
48
|
+
| 'GAP'
|
|
48
49
|
|
|
49
50
|
export type InputType =
|
|
50
51
|
| ColorPalette
|
|
@@ -104,6 +105,7 @@ class GenerateMCLClass extends MCLTheme {
|
|
|
104
105
|
case 'OPACITY':
|
|
105
106
|
return this.getOpacityClass()
|
|
106
107
|
case 'MARGINB':
|
|
108
|
+
case 'GAP':
|
|
107
109
|
return this.getSpacingClass()
|
|
108
110
|
default:
|
|
109
111
|
return
|
|
@@ -221,10 +223,11 @@ class GenerateMCLClass extends MCLTheme {
|
|
|
221
223
|
return opacity[this.classValue]
|
|
222
224
|
}
|
|
223
225
|
getSpacingClass(): string {
|
|
224
|
-
const { marginBottom } = MCLTheme
|
|
226
|
+
const { marginBottom, gap } = MCLTheme
|
|
225
227
|
if (this.classType === 'MARGINB') {
|
|
226
228
|
return marginBottom[this.classValue]
|
|
227
229
|
}
|
|
230
|
+
return gap[this.classValue]
|
|
228
231
|
}
|
|
229
232
|
}
|
|
230
233
|
|
package/theme/theme.ts
CHANGED
|
@@ -549,6 +549,19 @@ abstract class MCLTheme {
|
|
|
549
549
|
'2xl': 'mb-2xl',
|
|
550
550
|
'3xl': 'mb-3xl',
|
|
551
551
|
}
|
|
552
|
+
// spacing gap class for flex/grid
|
|
553
|
+
protected static gap: Spacing = {
|
|
554
|
+
'0': 'gap-0',
|
|
555
|
+
'3xs': 'gap-3xs',
|
|
556
|
+
'2xs': 'gap-2xs',
|
|
557
|
+
xs: 'gap-xs',
|
|
558
|
+
sm: 'gap-sm',
|
|
559
|
+
md: 'gap-md',
|
|
560
|
+
lg: 'gap-lg',
|
|
561
|
+
xl: 'gap-xl',
|
|
562
|
+
'2xl': 'gap-2xl',
|
|
563
|
+
'3xl': 'gap-3xl',
|
|
564
|
+
}
|
|
552
565
|
}
|
|
553
566
|
|
|
554
567
|
export default MCLTheme
|