@bobbykim/manguito-theme 0.1.2 → 0.1.4

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": "@bobbykim/manguito-theme",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
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": "043ea8b9d21660b299d1d70e37b135dded540170"
20
+ "gitHead": "690a0c4e354da9ec206a97e04508d078506fe2bd"
21
21
  }
@@ -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