@bobbykim/manguito-theme 0.1.4 → 0.3.0
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/README.md +46 -5
- package/index.ts +22 -4
- package/package.json +2 -2
- package/theme/index.ts +658 -0
- package/theme/theme.ts +398 -112
- package/theme/theme.types.ts +15 -6
- package/themeVariables.cjs +456 -181
- package/theme/generateClass.ts +0 -234
package/README.md
CHANGED
|
@@ -21,16 +21,57 @@ tailwind.config.cjs
|
|
|
21
21
|
```cjs
|
|
22
22
|
const {
|
|
23
23
|
mclTheme,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
} = require('./src/components/manguito-theme/themeVariables.cjs')
|
|
25
|
+
module.exports = {
|
|
26
|
+
content: [
|
|
27
|
+
'./src/**/*.{vue,ts,js,cjs}',
|
|
28
|
+
'./node_modules/@bobbykim/**/*.{vue,ts,js,cjs}',
|
|
29
|
+
],
|
|
30
|
+
plugins: [mclTheme()],
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Theme color configuration
|
|
35
|
+
|
|
36
|
+
You can change theme colors by adding colors/spacing in `tailwind.config.cjs`
|
|
26
37
|
|
|
38
|
+
```cjs
|
|
27
39
|
module.exports = {
|
|
28
40
|
content: [
|
|
29
41
|
'./src/**/*.{vue,ts,js,cjs}',
|
|
30
42
|
'./node_modules/@bobbykim/**/*.{vue,ts,js,cjs}',
|
|
31
43
|
],
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
plugins: [
|
|
45
|
+
mclTheme({
|
|
46
|
+
colors: {
|
|
47
|
+
primary: '#ec489a',
|
|
48
|
+
secondary: '#00feda',
|
|
49
|
+
success: '#78be20',
|
|
50
|
+
info: '#00a3e0',
|
|
51
|
+
warning: '#f1ac18',
|
|
52
|
+
danger: '#cc2f2f',
|
|
53
|
+
'light-1': '#fafafa',
|
|
54
|
+
'light-2': '#f1f1f1',
|
|
55
|
+
'light-3': '#e8e8e8',
|
|
56
|
+
'light-4': '#d0d0d0',
|
|
57
|
+
'dark-1': '#747474',
|
|
58
|
+
'dark-2': '#484848',
|
|
59
|
+
'dark-3': '#1f2937',
|
|
60
|
+
'dark-4': '#191919',
|
|
61
|
+
},
|
|
62
|
+
spacing: {
|
|
63
|
+
'3xs': '4px',
|
|
64
|
+
'2xs': '8px',
|
|
65
|
+
xs: '16px',
|
|
66
|
+
sm: '24px',
|
|
67
|
+
md: '32px',
|
|
68
|
+
lg: '48px',
|
|
69
|
+
xl: '64px',
|
|
70
|
+
'2xl': '96px',
|
|
71
|
+
'3xl': '128px',
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
],
|
|
34
75
|
}
|
|
35
76
|
```
|
|
36
77
|
|
|
@@ -51,7 +92,7 @@ import type { <Type you need> } from '@bobbykim/manguito-theme/theme/theme.types
|
|
|
51
92
|
<template>...</template>
|
|
52
93
|
```
|
|
53
94
|
|
|
54
|
-
##
|
|
95
|
+
## Maintainers
|
|
55
96
|
|
|
56
97
|
- **Bobby Kim** - _Initial work_
|
|
57
98
|
|
package/index.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import GenerateMCLClass
|
|
2
|
-
|
|
1
|
+
import GenerateMCLClass, {
|
|
2
|
+
colorType,
|
|
3
|
+
textType,
|
|
4
|
+
borderWidthType,
|
|
5
|
+
scaleType,
|
|
6
|
+
} from './theme'
|
|
7
|
+
import type { ClassType, InputType } from './theme/index.js'
|
|
3
8
|
|
|
4
9
|
const generateClass = (type: ClassType, value: InputType): string => {
|
|
10
|
+
console.log('running generate class')
|
|
5
11
|
const mclGenerate = new GenerateMCLClass(type, value)
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
if ((<string[]>(<unknown>colorType)).includes(type)) {
|
|
13
|
+
return mclGenerate.generateColorClass()
|
|
14
|
+
}
|
|
15
|
+
if ((<string[]>(<unknown>textType)).includes(type)) {
|
|
16
|
+
return mclGenerate.generateTextClass()
|
|
17
|
+
}
|
|
18
|
+
if ((<string[]>(<unknown>borderWidthType)).includes(type)) {
|
|
19
|
+
return mclGenerate.generateBorderWidthClass()
|
|
20
|
+
}
|
|
21
|
+
if ((<string[]>(<unknown>scaleType)).includes(type)) {
|
|
22
|
+
return mclGenerate.generateScaleClass()
|
|
23
|
+
}
|
|
24
|
+
// return spacing type if all of above is false
|
|
25
|
+
return mclGenerate.generateSpacingClass()
|
|
8
26
|
}
|
|
9
27
|
|
|
10
28
|
export default generateClass
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/manguito-theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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": "2c169fa8137650bf3fbc02ef2158c4c4e147a9ce"
|
|
21
21
|
}
|