@bobbykim/manguito-theme 0.1.1 → 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/LICENSE.md +9 -9
- package/README.md +60 -0
- package/index.ts +10 -10
- package/package.json +3 -2
- package/theme/generateClass.ts +234 -231
- package/theme/theme.ts +567 -554
- package/theme/theme.types.ts +57 -57
- package/themeVariables.cjs +210 -210
package/LICENSE.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022-present Bobby Kim
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-present Bobby Kim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @bobbykim/manguito-theme
|
|
2
|
+
|
|
3
|
+
manguito-theme includes basic config for MCL, including theme.types and generateClass function that returns tailwindCSS style classes.
|
|
4
|
+
|
|
5
|
+
## Demo
|
|
6
|
+
|
|
7
|
+
[MCL Histoire Page](https://manguito-component-library.vercel.app/story/src-stories-documentation-mcltheme-story-vue?variantId=src-stories-documentation-mcltheme-story-vue-0)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i -D tailwindcss postcss autoprefixer sass
|
|
13
|
+
npm i @bobbykim/manguito-theme
|
|
14
|
+
npx tailwindcss init -p
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
tailwind.config.cjs
|
|
20
|
+
|
|
21
|
+
```cjs
|
|
22
|
+
const {
|
|
23
|
+
mclTheme,
|
|
24
|
+
mclHeading,
|
|
25
|
+
} = require('@bobbykim/manguito-theme/themeVariables.cjs')
|
|
26
|
+
|
|
27
|
+
module.exports = {
|
|
28
|
+
content: [
|
|
29
|
+
'./src/**/*.{vue,ts,js,cjs}',
|
|
30
|
+
'./node_modules/@bobbykim/**/*.{vue,ts,js,cjs}',
|
|
31
|
+
],
|
|
32
|
+
theme: mclTheme,
|
|
33
|
+
plugins: [mclHeading],
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
`import generateClass from '@bobbykim/manguito-theme'`
|
|
40
|
+
|
|
41
|
+
in Vue component file.
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
...
|
|
46
|
+
import generateClass from '@bobbykim/manguito-theme'
|
|
47
|
+
import type { <Type you need> } from '@bobbykim/manguito-theme/theme/theme.types'
|
|
48
|
+
...
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>...</template>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Authors
|
|
55
|
+
|
|
56
|
+
- **Bobby Kim** - _Initial work_
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
This project is licensed under the MIT License - see the [LICENSE.md](./LICENSE.md) file for details
|
package/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import GenerateMCLClass from './theme/generateClass'
|
|
2
|
-
import type { ClassType, InputType } from './theme/generateClass'
|
|
3
|
-
|
|
4
|
-
const generateClass = (type: ClassType, value: InputType): string => {
|
|
5
|
-
const mclGenerate = new GenerateMCLClass(type, value)
|
|
6
|
-
|
|
7
|
-
return mclGenerate.generateClassName()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default generateClass
|
|
1
|
+
import GenerateMCLClass from './theme/generateClass'
|
|
2
|
+
import type { ClassType, InputType } from './theme/generateClass'
|
|
3
|
+
|
|
4
|
+
const generateClass = (type: ClassType, value: InputType): string => {
|
|
5
|
+
const mclGenerate = new GenerateMCLClass(type, value)
|
|
6
|
+
|
|
7
|
+
return mclGenerate.generateClassName()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default generateClass
|
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",
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
"name": "Bobby Kim",
|
|
12
12
|
"url": "https://www.devbobbykim.com/"
|
|
13
13
|
},
|
|
14
|
+
"homepage": "https://manguito-component-library.vercel.app/",
|
|
14
15
|
"repository": {
|
|
15
16
|
"type": "git",
|
|
16
17
|
"url": "https://github.com/bobbykim89/manguito-component-library.git"
|
|
17
18
|
},
|
|
18
19
|
"license": "MIT",
|
|
19
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "4e6b9b908a17893f6e6baab01741dc0dde771ac8"
|
|
20
21
|
}
|
package/theme/generateClass.ts
CHANGED
|
@@ -1,231 +1,234 @@
|
|
|
1
|
-
import MCLTheme from './theme'
|
|
2
|
-
import type {
|
|
3
|
-
ColorPalette,
|
|
4
|
-
HeadingSize,
|
|
5
|
-
BodyText,
|
|
6
|
-
FontWeight,
|
|
7
|
-
Range,
|
|
8
|
-
OpacityRange,
|
|
9
|
-
SpacingLevel,
|
|
10
|
-
} from './theme.types'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @TailwindCSS - Good practice is to let all of used classes to be in full instead of generated dynamically using methods such as string literal.
|
|
14
|
-
* @Interface - ClassType to define the case, and Input type to generate tailwind clssname.
|
|
15
|
-
* @Export GenerateRDSClass - extends RDSTheme class
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
export type ClassType =
|
|
19
|
-
| 'BGCOLOR'
|
|
20
|
-
| 'BEFOREBG'
|
|
21
|
-
| 'AFTERBG'
|
|
22
|
-
| 'TEXTCOLOR'
|
|
23
|
-
| 'DISABLEDTEXTCOLOR'
|
|
24
|
-
| 'SVGFILL'
|
|
25
|
-
| 'RINGCOLOR'
|
|
26
|
-
| 'FOCUSRING'
|
|
27
|
-
| 'ACTIVERING'
|
|
28
|
-
| 'ACTIVEBG'
|
|
29
|
-
| 'H1'
|
|
30
|
-
| 'H2'
|
|
31
|
-
| 'H3'
|
|
32
|
-
| 'H4'
|
|
33
|
-
| 'BODYTEXT'
|
|
34
|
-
| 'FONTWEIGHT'
|
|
35
|
-
| 'BORDER'
|
|
36
|
-
| 'BORDERX'
|
|
37
|
-
| 'BORDERY'
|
|
38
|
-
| 'BORDERT'
|
|
39
|
-
| 'BORDERL'
|
|
40
|
-
| 'BORDERB'
|
|
41
|
-
| 'BORDERTW'
|
|
42
|
-
| 'BORDERLW'
|
|
43
|
-
| 'HVBGCOLOR'
|
|
44
|
-
| 'HVTEXTCOLOR'
|
|
45
|
-
| 'BGOPACITY'
|
|
46
|
-
| 'OPACITY'
|
|
47
|
-
| 'MARGINB'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
case '
|
|
71
|
-
case '
|
|
72
|
-
case '
|
|
73
|
-
case '
|
|
74
|
-
case '
|
|
75
|
-
case '
|
|
76
|
-
case '
|
|
77
|
-
case '
|
|
78
|
-
case '
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
case '
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
case '
|
|
85
|
-
case '
|
|
86
|
-
case '
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
case '
|
|
94
|
-
case '
|
|
95
|
-
case '
|
|
96
|
-
case '
|
|
97
|
-
case '
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
case '
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
|
|
1
|
+
import MCLTheme from './theme'
|
|
2
|
+
import type {
|
|
3
|
+
ColorPalette,
|
|
4
|
+
HeadingSize,
|
|
5
|
+
BodyText,
|
|
6
|
+
FontWeight,
|
|
7
|
+
Range,
|
|
8
|
+
OpacityRange,
|
|
9
|
+
SpacingLevel,
|
|
10
|
+
} from './theme.types'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @TailwindCSS - Good practice is to let all of used classes to be in full instead of generated dynamically using methods such as string literal.
|
|
14
|
+
* @Interface - ClassType to define the case, and Input type to generate tailwind clssname.
|
|
15
|
+
* @Export GenerateRDSClass - extends RDSTheme class
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export type ClassType =
|
|
19
|
+
| 'BGCOLOR'
|
|
20
|
+
| 'BEFOREBG'
|
|
21
|
+
| 'AFTERBG'
|
|
22
|
+
| 'TEXTCOLOR'
|
|
23
|
+
| 'DISABLEDTEXTCOLOR'
|
|
24
|
+
| 'SVGFILL'
|
|
25
|
+
| 'RINGCOLOR'
|
|
26
|
+
| 'FOCUSRING'
|
|
27
|
+
| 'ACTIVERING'
|
|
28
|
+
| 'ACTIVEBG'
|
|
29
|
+
| 'H1'
|
|
30
|
+
| 'H2'
|
|
31
|
+
| 'H3'
|
|
32
|
+
| 'H4'
|
|
33
|
+
| 'BODYTEXT'
|
|
34
|
+
| 'FONTWEIGHT'
|
|
35
|
+
| 'BORDER'
|
|
36
|
+
| 'BORDERX'
|
|
37
|
+
| 'BORDERY'
|
|
38
|
+
| 'BORDERT'
|
|
39
|
+
| 'BORDERL'
|
|
40
|
+
| 'BORDERB'
|
|
41
|
+
| 'BORDERTW'
|
|
42
|
+
| 'BORDERLW'
|
|
43
|
+
| 'HVBGCOLOR'
|
|
44
|
+
| 'HVTEXTCOLOR'
|
|
45
|
+
| 'BGOPACITY'
|
|
46
|
+
| 'OPACITY'
|
|
47
|
+
| 'MARGINB'
|
|
48
|
+
| 'GAP'
|
|
49
|
+
|
|
50
|
+
export type InputType =
|
|
51
|
+
| ColorPalette
|
|
52
|
+
| HeadingSize
|
|
53
|
+
| BodyText
|
|
54
|
+
| FontWeight
|
|
55
|
+
| Range<12>
|
|
56
|
+
| OpacityRange
|
|
57
|
+
| SpacingLevel
|
|
58
|
+
|
|
59
|
+
class GenerateMCLClass extends MCLTheme {
|
|
60
|
+
classType: ClassType
|
|
61
|
+
classValue: InputType
|
|
62
|
+
|
|
63
|
+
constructor(classType: ClassType, classValue: InputType) {
|
|
64
|
+
super()
|
|
65
|
+
this.classType = classType
|
|
66
|
+
this.classValue = classValue
|
|
67
|
+
}
|
|
68
|
+
generateClassName(): string {
|
|
69
|
+
switch (this.classType) {
|
|
70
|
+
case 'BGCOLOR':
|
|
71
|
+
case 'BEFOREBG':
|
|
72
|
+
case 'AFTERBG':
|
|
73
|
+
case 'TEXTCOLOR':
|
|
74
|
+
case 'DISABLEDTEXTCOLOR':
|
|
75
|
+
case 'SVGFILL':
|
|
76
|
+
case 'RINGCOLOR':
|
|
77
|
+
case 'FOCUSRING':
|
|
78
|
+
case 'ACTIVERING':
|
|
79
|
+
case 'ACTIVEBG':
|
|
80
|
+
return this.getColorClass()
|
|
81
|
+
case 'HVBGCOLOR':
|
|
82
|
+
case 'HVTEXTCOLOR':
|
|
83
|
+
return this.getHoverColorClass()
|
|
84
|
+
case 'H1':
|
|
85
|
+
case 'H2':
|
|
86
|
+
case 'H3':
|
|
87
|
+
case 'H4':
|
|
88
|
+
return this.getHeadingTextSizeClass()
|
|
89
|
+
case 'BODYTEXT':
|
|
90
|
+
return this.getBodyTextSizeClass()
|
|
91
|
+
case 'FONTWEIGHT':
|
|
92
|
+
return this.getFontWeightClass()
|
|
93
|
+
case 'BORDER':
|
|
94
|
+
case 'BORDERX':
|
|
95
|
+
case 'BORDERY':
|
|
96
|
+
case 'BORDERT':
|
|
97
|
+
case 'BORDERB':
|
|
98
|
+
case 'BORDERL':
|
|
99
|
+
return this.getBorderColorClass()
|
|
100
|
+
case 'BORDERTW':
|
|
101
|
+
case 'BORDERLW':
|
|
102
|
+
return this.getBorderWidthClass()
|
|
103
|
+
case 'BGOPACITY':
|
|
104
|
+
return this.getBgOpacityClass()
|
|
105
|
+
case 'OPACITY':
|
|
106
|
+
return this.getOpacityClass()
|
|
107
|
+
case 'MARGINB':
|
|
108
|
+
case 'GAP':
|
|
109
|
+
return this.getSpacingClass()
|
|
110
|
+
default:
|
|
111
|
+
return
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
getColorClass(): string {
|
|
115
|
+
const {
|
|
116
|
+
bgColor,
|
|
117
|
+
beforeBgColor,
|
|
118
|
+
afterBgColor,
|
|
119
|
+
textColor,
|
|
120
|
+
disabledTextColor,
|
|
121
|
+
svgFillColor,
|
|
122
|
+
ringColor,
|
|
123
|
+
ringFocusColor,
|
|
124
|
+
ringActiveColor,
|
|
125
|
+
bgActiveColor,
|
|
126
|
+
} = MCLTheme
|
|
127
|
+
if (this.classType === 'BGCOLOR') {
|
|
128
|
+
return bgColor[this.classValue]
|
|
129
|
+
}
|
|
130
|
+
if (this.classType === 'BEFOREBG') {
|
|
131
|
+
return beforeBgColor[this.classValue]
|
|
132
|
+
}
|
|
133
|
+
if (this.classType === 'AFTERBG') {
|
|
134
|
+
return afterBgColor[this.classValue]
|
|
135
|
+
}
|
|
136
|
+
if (this.classType === 'TEXTCOLOR') {
|
|
137
|
+
return textColor[this.classValue]
|
|
138
|
+
}
|
|
139
|
+
if (this.classType === 'DISABLEDTEXTCOLOR') {
|
|
140
|
+
return disabledTextColor[this.classValue]
|
|
141
|
+
}
|
|
142
|
+
if (this.classType === 'SVGFILL') {
|
|
143
|
+
return svgFillColor[this.classValue]
|
|
144
|
+
}
|
|
145
|
+
if (this.classType === 'FOCUSRING') {
|
|
146
|
+
return ringFocusColor[this.classValue]
|
|
147
|
+
}
|
|
148
|
+
if (this.classType === 'ACTIVERING') {
|
|
149
|
+
return ringActiveColor[this.classValue]
|
|
150
|
+
}
|
|
151
|
+
if (this.classType === 'ACTIVEBG') {
|
|
152
|
+
return bgActiveColor[this.classValue]
|
|
153
|
+
}
|
|
154
|
+
return ringColor[this.classValue]
|
|
155
|
+
}
|
|
156
|
+
getHoverColorClass(): string {
|
|
157
|
+
const { hoverBgColor, hoverTextColor } = MCLTheme
|
|
158
|
+
if (this.classType === 'HVBGCOLOR') {
|
|
159
|
+
return hoverBgColor[this.classValue]
|
|
160
|
+
}
|
|
161
|
+
return hoverTextColor[this.classValue]
|
|
162
|
+
}
|
|
163
|
+
getHeadingTextSizeClass(): string {
|
|
164
|
+
const { heading1, heading2, heading3, heading4 } = MCLTheme
|
|
165
|
+
if (this.classType === 'H1') {
|
|
166
|
+
return heading1[this.classValue]
|
|
167
|
+
}
|
|
168
|
+
if (this.classType === 'H2') {
|
|
169
|
+
return heading2[this.classValue]
|
|
170
|
+
}
|
|
171
|
+
if (this.classType === 'H3') {
|
|
172
|
+
return heading3[this.classValue]
|
|
173
|
+
}
|
|
174
|
+
return heading4[this.classValue]
|
|
175
|
+
}
|
|
176
|
+
getBodyTextSizeClass(): string {
|
|
177
|
+
const { bodyText } = MCLTheme
|
|
178
|
+
return bodyText[this.classValue]
|
|
179
|
+
}
|
|
180
|
+
getFontWeightClass(): string {
|
|
181
|
+
const { fontweight } = MCLTheme
|
|
182
|
+
return fontweight[this.classValue]
|
|
183
|
+
}
|
|
184
|
+
getBorderColorClass(): string {
|
|
185
|
+
const {
|
|
186
|
+
borderColor,
|
|
187
|
+
borderXColor,
|
|
188
|
+
borderYColor,
|
|
189
|
+
borderTopColor,
|
|
190
|
+
borderBottomColor,
|
|
191
|
+
borderLeftColor,
|
|
192
|
+
} = MCLTheme
|
|
193
|
+
if (this.classType === 'BORDERX') {
|
|
194
|
+
return borderXColor[this.classValue]
|
|
195
|
+
}
|
|
196
|
+
if (this.classType === 'BORDERY') {
|
|
197
|
+
return borderYColor[this.classValue]
|
|
198
|
+
}
|
|
199
|
+
if (this.classType === 'BORDERT') {
|
|
200
|
+
return borderTopColor[this.classValue]
|
|
201
|
+
}
|
|
202
|
+
if (this.classType === 'BORDERB') {
|
|
203
|
+
return borderBottomColor[this.classValue]
|
|
204
|
+
}
|
|
205
|
+
if (this.classType === 'BORDERL') {
|
|
206
|
+
return borderLeftColor[this.classValue]
|
|
207
|
+
}
|
|
208
|
+
return borderColor[this.classValue]
|
|
209
|
+
}
|
|
210
|
+
getBorderWidthClass(): string {
|
|
211
|
+
const { borderTopWidth, borderLeftWidth } = MCLTheme
|
|
212
|
+
if (this.classType === 'BORDERTW') {
|
|
213
|
+
return borderTopWidth[this.classValue]
|
|
214
|
+
}
|
|
215
|
+
return borderLeftWidth[this.classValue]
|
|
216
|
+
}
|
|
217
|
+
getBgOpacityClass(): string {
|
|
218
|
+
const { backgroundOpacity } = MCLTheme
|
|
219
|
+
return backgroundOpacity[this.classValue]
|
|
220
|
+
}
|
|
221
|
+
getOpacityClass(): string {
|
|
222
|
+
const { opacity } = MCLTheme
|
|
223
|
+
return opacity[this.classValue]
|
|
224
|
+
}
|
|
225
|
+
getSpacingClass(): string {
|
|
226
|
+
const { marginBottom, gap } = MCLTheme
|
|
227
|
+
if (this.classType === 'MARGINB') {
|
|
228
|
+
return marginBottom[this.classValue]
|
|
229
|
+
}
|
|
230
|
+
return gap[this.classValue]
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export default GenerateMCLClass
|