@fullstackunicorn/style 1.0.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 +218 -0
- package/abstracts/init.js +12 -0
- package/commands.js +15 -0
- package/dependencies.js +2 -0
- package/index.js +108 -0
- package/package.json +52 -0
- package/sources/color.js +291 -0
- package/sources/files.js +216 -0
- package/sources/font.js +111 -0
- package/sources/parse.js +54 -0
- package/sources/style.js +215 -0
- package/sources/styles/base.js +78 -0
- package/sources/styles/border.js +70 -0
- package/sources/styles/flex.js +316 -0
- package/sources/styles/font.js +8 -0
- package/sources/styles/index.js +21 -0
- package/sources/styles/opacity.js +8 -0
- package/sources/styles/radius.js +35 -0
- package/sources/styles/size.js +164 -0
- package/sources/styles/space.js +140 -0
- package/sources/styles/text.js +162 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const border = {
|
|
2
|
+
target: `fixed`,
|
|
3
|
+
write: (n='') => ([`border${n}`]),
|
|
4
|
+
webClasses: (n) => ([`border${n}: 'border${n}'`]),
|
|
5
|
+
webStyle: (n) => ([`.border${n} { border-width:n.$px${n}; border-style:solid }`]),
|
|
6
|
+
nativeClasses: (n) => ([`border${n}: style['border${n}']`]),
|
|
7
|
+
nativeStyle: (n) => ([`border${n}: { borderWidth:${n}, borderStyle:'solid' }`])
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const borderX = {
|
|
11
|
+
target: `fixed`,
|
|
12
|
+
write: (n='') => ([`borderX${n}`]),
|
|
13
|
+
webClasses: (n) => ([`borderX${n}: 'borderX${n}'`]),
|
|
14
|
+
webStyle: (n) => ([`.borderX${n} { border-left-width:n.$px${n}; border-right-width:n.$px${n}; border-style:solid }`]),
|
|
15
|
+
nativeClasses: (n) => ([`borderX${n}: style['borderX${n}']`]),
|
|
16
|
+
nativeStyle: (n) => ([`borderX${n}: { borderLeftWidth:${n}, borderRightWidth:${n}, borderStyle:'solid' }`])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const borderY = {
|
|
20
|
+
target: `fixed`,
|
|
21
|
+
write: (n='') => ([`borderY${n}`]),
|
|
22
|
+
webClasses: (n) => ([`borderY${n}: 'borderY${n}'`]),
|
|
23
|
+
webStyle: (n) => ([`.borderY${n} { border-top-width:n.$px${n}; border-bottom-width:n.$px${n}; border-style:solid }`]),
|
|
24
|
+
nativeClasses: (n) => ([`borderY${n}: style['borderY${n}']`]),
|
|
25
|
+
nativeStyle: (n) => ([`borderY${n}: { borderTopWidth:${n}, borderBottomWidth:${n}, borderStyle:'solid' }`])
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const borderT = {
|
|
29
|
+
target: `fixed`,
|
|
30
|
+
write: (n='') => ([`borderT${n}`]),
|
|
31
|
+
webClasses: (n) => ([`borderT${n}: 'borderT${n}'`]),
|
|
32
|
+
webStyle: (n) => ([`.borderT${n} { border-top-width:n.$px${n}; border-style:solid }`]),
|
|
33
|
+
nativeClasses: (n) => ([`borderT${n}: style['borderT${n}']`]),
|
|
34
|
+
nativeStyle: (n) => ([`borderT${n}: { borderTopWidth:${n}, borderStyle:'solid' }`])
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const borderB = {
|
|
38
|
+
target: `fixed`,
|
|
39
|
+
write: (n='') => ([`borderB${n}`]),
|
|
40
|
+
webClasses: (n) => ([`borderB${n}: 'borderB${n}'`]),
|
|
41
|
+
webStyle: (n) => ([`.borderB${n} { border-bottom-width:n.$px${n}; border-style:solid }`]),
|
|
42
|
+
nativeClasses: (n) => ([`borderB${n}: style['borderB${n}']`]),
|
|
43
|
+
nativeStyle: (n) => ([`borderB${n}: { borderBottomWidth:${n}, borderStyle:'solid' }`])
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const borderS = {
|
|
47
|
+
target: `directional`,
|
|
48
|
+
write: (n='') => ([
|
|
49
|
+
`borderS${n}`,
|
|
50
|
+
`borderE${n}`
|
|
51
|
+
]),
|
|
52
|
+
webClasses: (n) => ([
|
|
53
|
+
`borderS${n}: isRTL ? 'borderL${n}' : 'borderR${n}'`,
|
|
54
|
+
`borderE${n}: isRTL ? 'borderR${n}' : 'borderL${n}'`
|
|
55
|
+
]),
|
|
56
|
+
webStyle: (n) => ([
|
|
57
|
+
`.borderL${n} { border-left-width:n.$px${n}; border-style:solid }`,
|
|
58
|
+
`.borderR${n} { border-right-width:n.$px${n}; border-style:solid }`
|
|
59
|
+
]),
|
|
60
|
+
nativeClasses: (n) => ([
|
|
61
|
+
`borderS${n}: style[isRTL ? 'borderL${n}' : 'borderR${n}']`,
|
|
62
|
+
`borderE${n}: style[isRTL ? 'borderR${n}' : 'borderL${n}']`
|
|
63
|
+
]),
|
|
64
|
+
nativeStyle: (n) => ([
|
|
65
|
+
`borderL${n}: { borderLeftWidth:${n}, borderStyle:'solid' }`,
|
|
66
|
+
`borderR${n}: { borderRightWidth:${n}, borderStyle:'solid' }`
|
|
67
|
+
])
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const borderE = borderS
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
const f_row = ({name, name_r, dir, dir_r}) => ({
|
|
2
|
+
target: `directional`,
|
|
3
|
+
write: () => ([
|
|
4
|
+
name,
|
|
5
|
+
name_r
|
|
6
|
+
]),
|
|
7
|
+
webClasses: () => ([
|
|
8
|
+
`${name}: isRTL ? '${name_r}' : '${name}'`,
|
|
9
|
+
`${name_r}: isRTL ? '${name}' : '${name_r}'`
|
|
10
|
+
]),
|
|
11
|
+
webStyle: () => ([
|
|
12
|
+
`.${name} { display:flex; flex-direction:${dir} }`,
|
|
13
|
+
`.${name_r} { display:flex; flex-direction:${dir_r} }`,
|
|
14
|
+
]),
|
|
15
|
+
nativeClasses: () => ([
|
|
16
|
+
`${name}: style[ isRTL ? '${name_r}' : '${name}' ]`,
|
|
17
|
+
`${name_r}: style[ isRTL ? '${name}' : '${name_r}' ]`,
|
|
18
|
+
]),
|
|
19
|
+
nativeStyle: () => ([
|
|
20
|
+
`${name}: { display:'flex', flexDirection:'${dir}' }`,
|
|
21
|
+
`${name_r}: { display:'flex', flexDirection:'${dir_r}' }`,
|
|
22
|
+
])
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export const row = f_row({name:'row', name_r:'row_r', dir:'row', dir_r:'row-reverse'})
|
|
26
|
+
export const row_r = f_row({name:'row_r', name_r:'row', dir:'row-reverse', dir_r:'row'})
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const f_row_X = ({name, name_r, dir, dir_r, x}) => ({
|
|
30
|
+
target: `directional`,
|
|
31
|
+
write: () => ([
|
|
32
|
+
name,
|
|
33
|
+
name_r
|
|
34
|
+
]),
|
|
35
|
+
webClasses: () => ([
|
|
36
|
+
`${name}: isRTL ? '${name_r}' : '${name}'`,
|
|
37
|
+
`${name_r}: isRTL ? '${name}' : '${name_r}'`
|
|
38
|
+
]),
|
|
39
|
+
webStyle: () => ([
|
|
40
|
+
`.${name} { display:flex; flex-direction:${dir}; justify-content:${x} }`,
|
|
41
|
+
`.${name_r} { display:flex; flex-direction:${dir_r}; justify-content:${x} }`,
|
|
42
|
+
]),
|
|
43
|
+
nativeClasses: () => ([
|
|
44
|
+
`${name}: style[ isRTL ? '${name_r}' : '${name}' ]`,
|
|
45
|
+
`${name_r}: style[ isRTL ? '${name}' : '${name_r}' ]`,
|
|
46
|
+
]),
|
|
47
|
+
nativeStyle: () => ([
|
|
48
|
+
`${name}: { display:'flex', flexDirection:'${dir}', justifyContent:'${x}' }`,
|
|
49
|
+
`${name_r}: { display:'flex', flexDirection:'${dir_r}', justifyContent:'${x}' }`,
|
|
50
|
+
])
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const row_sX = f_row_X({name:'row_sX', name_r:'row_sX_r', dir:'row', dir_r:'row-reverse', x:'flex-start'})
|
|
54
|
+
export const row_cX = f_row_X({name:'row_cX', name_r:'row_cX_r', dir:'row', dir_r:'row-reverse', x:'center'})
|
|
55
|
+
export const row_eX = f_row_X({name:'row_eX', name_r:'row_eX_r', dir:'row', dir_r:'row-reverse', x:'flex-end'})
|
|
56
|
+
|
|
57
|
+
export const row_sX_r = f_row_X({name:'row_sX_r', name_r:'row_sX', dir:'row-reverse', dir_r:'row', x:'flex-start'})
|
|
58
|
+
export const row_cX_r = f_row_X({name:'row_cX_r', name_r:'row_cX', dir:'row-reverse', dir_r:'row', x:'center'})
|
|
59
|
+
export const row_eX_r = f_row_X({name:'row_eX_r', name_r:'row_eX', dir:'row-reverse', dir_r:'row', x:'flex-end'})
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
const f_row_Y = ({name, name_r, dir, dir_r, y}) => ({
|
|
64
|
+
target: `directional`,
|
|
65
|
+
write: () => ([
|
|
66
|
+
name,
|
|
67
|
+
name_r
|
|
68
|
+
]),
|
|
69
|
+
webClasses: () => ([
|
|
70
|
+
`${name}: isRTL ? '${name_r}' : '${name}'`,
|
|
71
|
+
`${name_r}: isRTL ? '${name}' : '${name_r}'`
|
|
72
|
+
]),
|
|
73
|
+
webStyle: () => ([
|
|
74
|
+
`.${name} { display:flex; flex-direction:${dir}; align-items:${y} }`,
|
|
75
|
+
`.${name_r} { display:flex; flex-direction:${dir_r}; align-items:${y} }`,
|
|
76
|
+
]),
|
|
77
|
+
nativeClasses: () => ([
|
|
78
|
+
`${name}: style[ isRTL ? '${name_r}' : '${name}' ]`,
|
|
79
|
+
`${name_r}: style[ isRTL ? '${name}' : '${name_r}' ]`,
|
|
80
|
+
]),
|
|
81
|
+
nativeStyle: () => ([
|
|
82
|
+
`${name}: { display:'flex', flexDirection:'${dir}', alignItems:'${y}' }`,
|
|
83
|
+
`${name_r}: { display:'flex', flexDirection:'${dir_r}', alignItems:'${y}' }`,
|
|
84
|
+
])
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
export const row_sY = f_row_Y({name:'row_sY', name_r:'row_sY_r', dir:'row', dir_r:'row-reverse', y:'flex-start'})
|
|
88
|
+
export const row_cY = f_row_Y({name:'row_cY', name_r:'row_cY_r', dir:'row', dir_r:'row-reverse', y:'center'})
|
|
89
|
+
export const row_eY = f_row_Y({name:'row_eY', name_r:'row_eY_r', dir:'row', dir_r:'row-reverse', y:'flex-end'})
|
|
90
|
+
|
|
91
|
+
export const row_sY_r = f_row_Y({name:'row_sY_r', name_r:'row_sY', dir:'row-reverse', dir_r:'row', y:'flex-start'})
|
|
92
|
+
export const row_cY_r = f_row_Y({name:'row_cY_r', name_r:'row_cY', dir:'row-reverse', dir_r:'row', y:'center'})
|
|
93
|
+
export const row_eY_r = f_row_Y({name:'row_eY_r', name_r:'row_eY', dir:'row-reverse', dir_r:'row', y:'flex-end'})
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
const f_row_XY = ({name, name_r, dir, dir_r, x, y}) => ({
|
|
98
|
+
target: `directional`,
|
|
99
|
+
write: () => ([
|
|
100
|
+
name,
|
|
101
|
+
name_r
|
|
102
|
+
]),
|
|
103
|
+
webClasses: () => ([
|
|
104
|
+
`${name}: isRTL ? '${name_r}' : '${name}'`,
|
|
105
|
+
`${name_r}: isRTL ? '${name}' : '${name_r}'`
|
|
106
|
+
]),
|
|
107
|
+
webStyle: () => ([
|
|
108
|
+
`.${name} { display:flex; flex-direction:${dir}; justify-content:${x}; align-items:${y} }`,
|
|
109
|
+
`.${name_r} { display:flex; flex-direction:${dir_r}; justify-content:${x}; align-items:${y} }`,
|
|
110
|
+
]),
|
|
111
|
+
nativeClasses: () => ([
|
|
112
|
+
`${name}: style[ isRTL ? '${name_r}' : '${name}' ]`,
|
|
113
|
+
`${name_r}: style[ isRTL ? '${name}' : '${name_r}' ]`,
|
|
114
|
+
]),
|
|
115
|
+
nativeStyle: () => ([
|
|
116
|
+
`${name}: { display:'flex', flexDirection:'${dir}', justifyContent:'${x}', alignItems:'${y}' }`,
|
|
117
|
+
`${name_r}: { display:'flex', flexDirection:'${dir_r}', justifyContent:'${x}', alignItems:'${y}' }`,
|
|
118
|
+
])
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
export const row_sXsY = f_row_XY({name:'row_sXsY', name_r:'row_sXsY_r', dir:'row', dir_r:'row-reverse', x:'flex-start', y:'flex-start'})
|
|
122
|
+
export const row_sXcY = f_row_XY({name:'row_sXcY', name_r:'row_sXcY_r', dir:'row', dir_r:'row-reverse', x:'flex-start', y:'center'})
|
|
123
|
+
export const row_sXeY = f_row_XY({name:'row_sXeY', name_r:'row_sXeY_r', dir:'row', dir_r:'row-reverse', x:'flex-start', y:'flex-end'})
|
|
124
|
+
|
|
125
|
+
export const row_cXsY = f_row_XY({name:'row_cXsY', name_r:'row_cXsY_r', dir:'row', dir_r:'row-reverse', x:'center', y:'flex-start'})
|
|
126
|
+
export const row_cXcY = f_row_XY({name:'row_cXcY', name_r:'row_cXcY_r', dir:'row', dir_r:'row-reverse', x:'center', y:'center'})
|
|
127
|
+
export const row_cXeY = f_row_XY({name:'row_cXeY', name_r:'row_cXeY_r', dir:'row', dir_r:'row-reverse', x:'center', y:'flex-end'})
|
|
128
|
+
|
|
129
|
+
export const row_eXsY = f_row_XY({name:'row_eXsY', name_r:'row_eXsY_r', dir:'row', dir_r:'row-reverse', x:'flex-end', y:'flex-start'})
|
|
130
|
+
export const row_eXcY = f_row_XY({name:'row_eXcY', name_r:'row_eXcY_r', dir:'row', dir_r:'row-reverse', x:'flex-end', y:'center'})
|
|
131
|
+
export const row_eXeY = f_row_XY({name:'row_eXeY', name_r:'row_eXeY_r', dir:'row', dir_r:'row-reverse', x:'flex-end', y:'flex-end'})
|
|
132
|
+
|
|
133
|
+
export const row_sXsY_r = f_row_XY({name:'row_sXsY_r', name_r:'row_sXsY', dir:'row-reverse', dir_r:'row', x:'flex-start', y:'flex-start'})
|
|
134
|
+
export const row_sXcY_r = f_row_XY({name:'row_sXcY_r', name_r:'row_sXcY', dir:'row-reverse', dir_r:'row', x:'flex-start', y:'center'})
|
|
135
|
+
export const row_sXeY_r = f_row_XY({name:'row_sXeY_r', name_r:'row_sXeY', dir:'row-reverse', dir_r:'row', x:'flex-start', y:'flex-end'})
|
|
136
|
+
|
|
137
|
+
export const row_cXsY_r = f_row_XY({name:'row_cXsY_r', name_r:'row_cXsY', dir:'row-reverse', dir_r:'row', x:'center', y:'flex-start'})
|
|
138
|
+
export const row_cXcY_r = f_row_XY({name:'row_cXcY_r', name_r:'row_cXcY', dir:'row-reverse', dir_r:'row', x:'center', y:'center'})
|
|
139
|
+
export const row_cXeY_r = f_row_XY({name:'row_cXeY_r', name_r:'row_cXeY', dir:'row-reverse', dir_r:'row', x:'center', y:'flex-end'})
|
|
140
|
+
|
|
141
|
+
export const row_eXsY_r = f_row_XY({name:'row_eXsY_r', name_r:'row_eXsY', dir:'row-reverse', dir_r:'row', x:'flex-end', y:'flex-start'})
|
|
142
|
+
export const row_eXcY_r = f_row_XY({name:'row_eXcY_r', name_r:'row_eXcY', dir:'row-reverse', dir_r:'row', x:'flex-end', y:'center'})
|
|
143
|
+
export const row_eXeY_r = f_row_XY({name:'row_eXeY_r', name_r:'row_eXeY', dir:'row-reverse', dir_r:'row', x:'flex-end', y:'flex-end'})
|
|
144
|
+
|
|
145
|
+
export const row_bXsY = f_row_XY({name:'row_bXsY', name_r:'row_bXsY_r', dir:'row', dir_r:'row-reverse', x:'space-between', y:'flex-start'})
|
|
146
|
+
export const row_bXcY = f_row_XY({name:'row_bXcY', name_r:'row_bXcY_r', dir:'row', dir_r:'row-reverse', x:'space-between', y:'center'})
|
|
147
|
+
export const row_bXeY = f_row_XY({name:'row_bXeY', name_r:'row_bXeY_r', dir:'row', dir_r:'row-reverse', x:'space-between', y:'flex-end'})
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
const f_col = ({name, x, y}) => ({
|
|
151
|
+
target: `fixed`,
|
|
152
|
+
write: () => ([ name ]),
|
|
153
|
+
webClasses: () => ([
|
|
154
|
+
`${name}: '${name}'`,
|
|
155
|
+
]),
|
|
156
|
+
webStyle: () => ([
|
|
157
|
+
`.${name} { display:flex; flex-direction:column${y?`; justify-content:${y}`:''}${x?`; align-items:${x}`:''} }`,
|
|
158
|
+
]),
|
|
159
|
+
nativeClasses: () => ([
|
|
160
|
+
`${name}: style['${name}']`,
|
|
161
|
+
]),
|
|
162
|
+
nativeStyle: () => ([
|
|
163
|
+
`${name}: { display:'flex', flexDirection:'column'${y?`, justifyContent:'${y}'`:''}${x?`, alignItems:'${x}'`:''} }`,
|
|
164
|
+
])
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
export const col = f_col({name:'col'})
|
|
168
|
+
|
|
169
|
+
export const col_sX = f_col({name:'col_sX', x:'flex-start'})
|
|
170
|
+
export const col_cX = f_col({name:'col_cX', x:'center'})
|
|
171
|
+
export const col_eX = f_col({name:'col_eX', x:'flex-end'})
|
|
172
|
+
|
|
173
|
+
export const col_sY = f_col({name:'col_sY', y:'flex-start'})
|
|
174
|
+
export const col_cY = f_col({name:'col_cY', y:'center'})
|
|
175
|
+
export const col_eY = f_col({name:'col_eY', y:'flex-end'})
|
|
176
|
+
|
|
177
|
+
export const col_sXsY = f_col({name:'col_sXsY', x:'flex-start', y:'flex-start'})
|
|
178
|
+
export const col_sXcY = f_col({name:'col_sXcY', x:'flex-start', y:'center'})
|
|
179
|
+
export const col_sXeY = f_col({name:'col_sXeY', x:'flex-start', y:'flex-end'})
|
|
180
|
+
|
|
181
|
+
export const col_cXsY = f_col({name:'col_cXsY', x:'center', y:'flex-start'})
|
|
182
|
+
export const col_cXcY = f_col({name:'col_cXcY', x:'center', y:'center'})
|
|
183
|
+
export const col_cXeY = f_col({name:'col_cXeY', x:'center', y:'flex-end'})
|
|
184
|
+
|
|
185
|
+
export const col_eXsY = f_col({name:'col_eXsY', x:'flex-end', y:'flex-start'})
|
|
186
|
+
export const col_eXcY = f_col({name:'col_eXcY', x:'flex-end', y:'center'})
|
|
187
|
+
export const col_eXeY = f_col({name:'col_eXeY', x:'flex-end', y:'flex-end'})
|
|
188
|
+
|
|
189
|
+
// find better solution
|
|
190
|
+
export const row_bX = {
|
|
191
|
+
target: `directional`,
|
|
192
|
+
write: () => ([
|
|
193
|
+
'row_bX',
|
|
194
|
+
'row_bX_r'
|
|
195
|
+
]),
|
|
196
|
+
webClasses: () => ([
|
|
197
|
+
`row_bX: isRTL ? 'row_bX_r' : 'row_bX'`,
|
|
198
|
+
`row_bX_r: isRTL ? 'row_bX' : 'row_bX_r'`
|
|
199
|
+
]),
|
|
200
|
+
webStyle: () => ([
|
|
201
|
+
`.row_bX { display:flex; flex-direction:row; justify-content:space-between }`,
|
|
202
|
+
`.row_bX_r { display:flex; flex-direction:row-reverse; justify-content:space-between }`,
|
|
203
|
+
]),
|
|
204
|
+
nativeClasses: () => ([
|
|
205
|
+
`row_bX: style[ isRTL ? 'row_bX_r' : 'row_bX' ]`,
|
|
206
|
+
`row_bX_r: style[ isRTL ? 'row_bX' : 'row_bX_r' ]`,
|
|
207
|
+
]),
|
|
208
|
+
nativeStyle: () => ([
|
|
209
|
+
`row_bX: { display:'flex', flexDirection:'row', justifyContent:'space-between' }`,
|
|
210
|
+
`row_bX_r: { display:'flex', flexDirection:'row-reverse', justifyContent:'space-between' }`,
|
|
211
|
+
])
|
|
212
|
+
}
|
|
213
|
+
export const row_bX_r = row_bX
|
|
214
|
+
|
|
215
|
+
export const flex = {
|
|
216
|
+
target: `fixed`,
|
|
217
|
+
write: (n='') => ([`flex${n}`]),
|
|
218
|
+
webClasses: (n) => ([`flex${n}: 'flex${n}'`]),
|
|
219
|
+
webStyle: (n) => ([`.flex${n} { flex:${n} }`]),
|
|
220
|
+
nativeClasses: (n) => ([`flex${n}: style['flex${n}']`]),
|
|
221
|
+
nativeStyle: (n) => ([`flex${n}: { flex:${n} }`])
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export const flexWrap = {
|
|
225
|
+
target: `fixed`,
|
|
226
|
+
write: () => ([`flexWrap`]),
|
|
227
|
+
webClasses: () => ([`flexWrap: 'flexWrap'`]),
|
|
228
|
+
webStyle: () => ([`.flexWrap { flex-wrap:wrap }`]),
|
|
229
|
+
nativeClasses: () => ([`flexWrap: style['flexWrap']`]),
|
|
230
|
+
nativeStyle: () => ([`flexWrap: { flexWrap:'wrap' }`])
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export const start = {
|
|
234
|
+
target: `directional`,
|
|
235
|
+
write: (n='') => ([
|
|
236
|
+
`start${n}`,
|
|
237
|
+
`end${n}`
|
|
238
|
+
]),
|
|
239
|
+
webClasses: (n) => ([
|
|
240
|
+
`start${n}: isRTL ? 'right${n}' : 'left${n}'`,
|
|
241
|
+
`end${n}: isRTL ? 'left${n}' : 'right${n}'`
|
|
242
|
+
]),
|
|
243
|
+
webStyle: (n) => ([
|
|
244
|
+
`.right${n} { right:n.$px${n} }`,
|
|
245
|
+
`.left${n} { left:n.$px${n} }`
|
|
246
|
+
]),
|
|
247
|
+
nativeClasses: (n) => ([
|
|
248
|
+
`start${n}: style[ isRTL ? 'right${n}' : 'left${n}']`,
|
|
249
|
+
`end${n}: style[ isRTL ? 'left${n}' : 'right${n}']`
|
|
250
|
+
]),
|
|
251
|
+
nativeStyle: (n) => ([
|
|
252
|
+
`right${n}: { right:${n} }`,
|
|
253
|
+
`left${n}: { left:${n} }`
|
|
254
|
+
])
|
|
255
|
+
}
|
|
256
|
+
export const end = start
|
|
257
|
+
|
|
258
|
+
export const top = {
|
|
259
|
+
target: `fixed`,
|
|
260
|
+
write: (n='') => ([`top${n}`]),
|
|
261
|
+
webClasses: (n) => ([`top${n}: 'top${n}'`]),
|
|
262
|
+
webStyle: (n) => ([`.top${n} { top:n.$px${n} }`]),
|
|
263
|
+
nativeClasses: (n) => ([`top${n}: style['top${n}']`]),
|
|
264
|
+
nativeStyle: (n) => ([`top${n}: { top:${n} }`])
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export const bottom = {
|
|
268
|
+
target: `fixed`,
|
|
269
|
+
write: (n='') => ([`bottom${n}`]),
|
|
270
|
+
webClasses: (n) => ([`bottom${n}: 'bottom${n}'`]),
|
|
271
|
+
webStyle: (n) => ([`.bottom${n} { bottom:n.$px${n} }`]),
|
|
272
|
+
nativeClasses: (n) => ([`bottom${n}: style['bottom${n}']`]),
|
|
273
|
+
nativeStyle: (n) => ([`bottom${n}: { bottom:${n} }`])
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// to be tested
|
|
277
|
+
|
|
278
|
+
const f_gap = (web, native, prefix) => ({
|
|
279
|
+
target: 'fixed',
|
|
280
|
+
write: (n = '') => ([`${prefix}${n}`]),
|
|
281
|
+
webClasses: (n) => ([`${prefix}${n}: '${prefix}${n}'`]),
|
|
282
|
+
webStyle: (n) => ([`.${prefix}${n} { ${web}: n.$px${n} }`]),
|
|
283
|
+
nativeClasses: (n) => ([`${prefix}${n}: style['${prefix}${n}']`]),
|
|
284
|
+
nativeStyle: (n) => ([`${prefix}${n}: { ${native}: ${n} }`]),
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
export const gap = f_gap('gap', 'gap', 'gap')
|
|
288
|
+
export const gapRow = f_gap('row-gap', 'rowGap', 'gapRow')
|
|
289
|
+
export const gapCol = f_gap('column-gap', 'columnGap', 'gapCol')
|
|
290
|
+
|
|
291
|
+
export const shrink = {
|
|
292
|
+
target: 'fixed',
|
|
293
|
+
write: (n = '') => ([`shrink${n}`]),
|
|
294
|
+
webClasses: (n) => ([`shrink${n}: 'shrink${n}'`]),
|
|
295
|
+
webStyle: (n) => ([`.shrink${n} { flex-shrink: ${n || 1} }`]),
|
|
296
|
+
nativeClasses: (n) => ([`shrink${n}: style['shrink${n}']`]),
|
|
297
|
+
nativeStyle: (n) => ([`shrink${n}: { flexShrink: ${n || 1} }`]),
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export const order = {
|
|
301
|
+
target: 'fixed',
|
|
302
|
+
write: (n = '') => ([`order${n}`]),
|
|
303
|
+
webClasses: (n) => ([`order${n}: 'order${n}'`]),
|
|
304
|
+
webStyle: (n) => ([`.order${n} { order: ${n} }`]),
|
|
305
|
+
nativeClasses: (n) => ([`order${n}: style['order${n}']`]),
|
|
306
|
+
nativeStyle: (n) => ([`order${n}: { order: ${n} }`]),
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export const orderm = {
|
|
310
|
+
target: 'fixed',
|
|
311
|
+
write: (n = '') => ([`order${n}m`]),
|
|
312
|
+
webClasses: (n) => ([`order${n}m: 'order${n}m'`]),
|
|
313
|
+
webStyle: (n) => ([`.order${n}m { order: -${n} }`]),
|
|
314
|
+
nativeClasses: (n) => ([`order${n}m: style['order${n}m']`]),
|
|
315
|
+
nativeStyle: (n) => ([`order${n}m: { order: -${n} }`]),
|
|
316
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// export const font = {
|
|
2
|
+
// target: `fixed`,
|
|
3
|
+
// write: (n='') => ([`font${n}`]),
|
|
4
|
+
// webClasses: (n) => ([`font${n}: 'font${n}'`]),
|
|
5
|
+
// webStyle: (n, fonts) => ([`.font${n} ${fonts[n].web}`]),
|
|
6
|
+
// nativeClasses: (n) => ([`font${n}: style['font${n}']`]),
|
|
7
|
+
// nativeStyle: (n, fonts) => ([`font${n}: ${fonts[n].native}`])
|
|
8
|
+
// }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as base from './base.js'
|
|
2
|
+
import * as border from './border.js'
|
|
3
|
+
import * as flex from './flex.js'
|
|
4
|
+
// import * as font from './font.js'
|
|
5
|
+
import * as opacity from './opacity.js'
|
|
6
|
+
import * as radius from './radius.js'
|
|
7
|
+
import * as size from './size.js'
|
|
8
|
+
import * as space from './space.js'
|
|
9
|
+
import * as text from './text.js'
|
|
10
|
+
|
|
11
|
+
export const styles = {
|
|
12
|
+
...base,
|
|
13
|
+
...border,
|
|
14
|
+
...flex,
|
|
15
|
+
// ...font,
|
|
16
|
+
...opacity,
|
|
17
|
+
...radius,
|
|
18
|
+
...size,
|
|
19
|
+
...space,
|
|
20
|
+
...text,
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const opacity = {
|
|
2
|
+
target: `fixed`,
|
|
3
|
+
write: (n='') => ([`opacity${n}`]),
|
|
4
|
+
webClasses: (n) => ([`opacity${n}: 'opacity${n}'`]),
|
|
5
|
+
webStyle: (n) => ([`.opacity${n} { opacity:${n/100} }`]),
|
|
6
|
+
nativeClasses: (n) => ([`opacity${n}: style['opacity${n}']`]),
|
|
7
|
+
nativeStyle: (n) => ([`opacity${n}: { opacity:${n/100} }`])
|
|
8
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const radiusRound = {
|
|
2
|
+
target: `fixed`,
|
|
3
|
+
write: () => ([`radiusRound`]),
|
|
4
|
+
webClasses: () => ([`radiusRound: 'radiusRound'`]),
|
|
5
|
+
webStyle: () => ([`.radiusRound { border-radius:100% }`]),
|
|
6
|
+
nativeClasses: () => ([`radiusRound: style['radiusRound']`]),
|
|
7
|
+
nativeStyle: () => ([`radiusRound: { borderRadius:'100%' }`])
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const radius = {
|
|
11
|
+
target: `fixed`,
|
|
12
|
+
write: (n='') => ([`radius${n}`]),
|
|
13
|
+
webClasses: (n) => ([`radius${n}: 'radius${n}'`]),
|
|
14
|
+
webStyle: (n) => ([`.radius${n} { border-radius:n.$px${n} }`]),
|
|
15
|
+
nativeClasses: (n) => ([`radius${n}: style['radius${n}']`]),
|
|
16
|
+
nativeStyle: (n) => ([`radius${n}: { borderRadius:${n} }`])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const radiusT = {
|
|
20
|
+
target: `fixed`,
|
|
21
|
+
write: (n='') => ([`radiusT${n}`]),
|
|
22
|
+
webClasses: (n) => ([`radiusT${n}: 'radiusT${n}'`]),
|
|
23
|
+
webStyle: (n) => ([`.radiusT${n} { border-top-left-radius:n.$px${n}; border-top-right-radius:n.$px${n} }`]),
|
|
24
|
+
nativeClasses: (n) => ([`radiusT${n}: style['radiusT${n}']`]),
|
|
25
|
+
nativeStyle: (n) => ([`radiusT${n}: { borderTopLeftRadius:${n}, borderTopRightRadius:${n} }`])
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const radiusB = {
|
|
29
|
+
target: `fixed`,
|
|
30
|
+
write: (n='') => ([`radiusB${n}`]),
|
|
31
|
+
webClasses: (n) => ([`radiusB${n}: 'radiusB${n}'`]),
|
|
32
|
+
webStyle: (n) => ([`.radiusB${n} { border-bottom-left-radius:n.$px${n}; border-bottom-right-radius:n.$px${n} }`]),
|
|
33
|
+
nativeClasses: (n) => ([`radiusB${n}: style['radiusB${n}']`]),
|
|
34
|
+
nativeStyle: (n) => ([`radiusB${n}: { borderBottomLeftRadius:${n}, borderBottomRightRadius:${n} }`])
|
|
35
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
export const X = {
|
|
2
|
+
target: `fixed`,
|
|
3
|
+
write: (n='') => ([`X${n}`]),
|
|
4
|
+
webClasses: (n='') => ([`X${n}: 'X${n}'`]),
|
|
5
|
+
webStyle: (n='') => ([`.X${n} { width:${n?`n.$px${n}`:`100%`}; max-width:${n?`n.$px${n}`:`100%`}; min-width:${n?`n.$px${n}`:`100%`} }`]),
|
|
6
|
+
nativeClasses: (n='') => ([`X${n}: style['X${n}']`]),
|
|
7
|
+
nativeStyle: (n='') => ([`X${n}: { width:${n?n:`'100%'`}, maxWidth:${n?n:`'100%'`}, minWidth:${n?n:`'100%'`} }`])
|
|
8
|
+
}
|
|
9
|
+
export const Xx = {
|
|
10
|
+
target: `fixed`,
|
|
11
|
+
write: (n='') => ([`Xx${n}`]),
|
|
12
|
+
webClasses: (n='') => ([`Xx${n}: 'Xx${n}'`]),
|
|
13
|
+
webStyle: (n='') => ([`.Xx${n} { width:${n?`n.$px${n}`:`100%`} }`]),
|
|
14
|
+
nativeClasses: (n='') => ([`Xx${n}: style['Xx${n}']`]),
|
|
15
|
+
nativeStyle: (n='') => ([`Xx${n}: { width:${n?n:`'100%'`} }`])
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export const Y = {
|
|
20
|
+
target: `fixed`,
|
|
21
|
+
write: (n='') => ([`Y${n}`]),
|
|
22
|
+
webClasses: (n='') => ([`Y${n}: 'Y${n}'`]),
|
|
23
|
+
webStyle: (n='') => ([`.Y${n} { height:${n?`n.$px${n}`:`100%`}; max-height:${n?`n.$px${n}`:`100%`}; min-height:${n?`n.$px${n}`:`100%`} }`]),
|
|
24
|
+
nativeClasses: (n='') => ([`Y${n}: style['Y${n}']`]),
|
|
25
|
+
nativeStyle: (n='') => ([`Y${n}: { height:${n?n:`'100%'`}, maxHeight:${n?n:`'100%'`}, minHeight:${n?n:`'100%'`} }`])
|
|
26
|
+
}
|
|
27
|
+
export const Yy = {
|
|
28
|
+
target: `fixed`,
|
|
29
|
+
write: (n='') => ([`Yy${n}`]),
|
|
30
|
+
webClasses: (n='') => ([`Yy${n}: 'Yy${n}'`]),
|
|
31
|
+
webStyle: (n='') => ([`.Yy${n} { height:${n?`n.$px${n}`:`100%`} }`]),
|
|
32
|
+
nativeClasses: (n='') => ([`Yy${n}: style['Yy${n}']`]),
|
|
33
|
+
nativeStyle: (n='') => ([`Yy${n}: { height:${n?n:`'100%'`} }`])
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const XY = {
|
|
37
|
+
target: `fixed`,
|
|
38
|
+
write: (n='') => ([`XY${n}`]),
|
|
39
|
+
webClasses: (n='') => ([`XY${n}: 'XY${n}'`]),
|
|
40
|
+
webStyle: (n='') => ([`.XY${n} { width:${n?`n.$px${n}`:`100%`}; max-width:${n?`n.$px${n}`:`100%`}; min-width:${n?`n.$px${n}`:`100%`}; height:${n?`n.$px${n}`:`100%`}; max-height:${n?`n.$px${n}`:`100%`}; min-height:${n?`n.$px${n}`:`100%`} }`]),
|
|
41
|
+
nativeClasses: (n='') => ([`XY${n}: style['XY${n}']`]),
|
|
42
|
+
nativeStyle: (n='') => ([`XY${n}: { width:${n?n:`'100%'`}, maxWidth:${n?n:`'100%'`}, minWidth:${n?n:`'100%'`}, height:${n?n:`'100%'`}, maxHeight:${n?n:`'100%'`}, minHeight:${n?n:`'100%'`} }`])
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Z = {
|
|
46
|
+
target: `fixed`,
|
|
47
|
+
write: (n='') => ([`Z${n}`]),
|
|
48
|
+
webClasses: (n) => ([`Z${n}: 'Z${n}'`]),
|
|
49
|
+
webStyle: (n) => ([`.Z${n} { z-index:${n} }`]),
|
|
50
|
+
nativeClasses: (n) => ([`Z${n}: style['Z${n}']`]),
|
|
51
|
+
nativeStyle: (n) => ([`Z${n}: { zIndex:${n} }`])
|
|
52
|
+
}
|
|
53
|
+
export const Zm = {
|
|
54
|
+
target: `fixed`,
|
|
55
|
+
write: (n='') => ([`Zm${n}`]),
|
|
56
|
+
webClasses: (n) => ([`Zm${n}: 'Zm${n}'`]),
|
|
57
|
+
webStyle: (n) => ([`.Zm${n} { z-index:-${n} }`]),
|
|
58
|
+
nativeClasses: (n) => ([`Zm${n}: style['Zm${n}']`]),
|
|
59
|
+
nativeStyle: (n) => ([`Zm${n}: { zIndex:-${n} }`])
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const Xmin = {
|
|
63
|
+
target: `fixed`,
|
|
64
|
+
write: (n='') => ([`Xmin${n}`]),
|
|
65
|
+
webClasses: (n='') => ([`Xmin${n}: 'Xmin${n}'`]),
|
|
66
|
+
webStyle: (n='') => ([`.Xmin${n} { min-width:n.$px${n} }`]),
|
|
67
|
+
nativeClasses: (n='') => ([`Xmin${n}: style['Xmin${n}']`]),
|
|
68
|
+
nativeStyle: (n='') => ([`Xmin${n}: { minWidth:${n} }`])
|
|
69
|
+
}
|
|
70
|
+
export const Xmax = {
|
|
71
|
+
target: `fixed`,
|
|
72
|
+
write: (n='') => ([`Xmax${n}`]),
|
|
73
|
+
webClasses: (n='') => ([`Xmax${n}: 'Xmax${n}'`]),
|
|
74
|
+
webStyle: (n='') => ([`.Xmax${n} { max-width:n.$px${n} }`]),
|
|
75
|
+
nativeClasses: (n='') => ([`Xmax${n}: style['Xmax${n}']`]),
|
|
76
|
+
nativeStyle: (n='') => ([`Xmax${n}: { maxWidth:${n} }`])
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const Ymin = {
|
|
80
|
+
target: `fixed`,
|
|
81
|
+
write: (n='') => ([`Ymin${n}`]),
|
|
82
|
+
webClasses: (n='') => ([`Ymin${n}: 'Ymin${n}'`]),
|
|
83
|
+
webStyle: (n='') => ([`.Ymin${n} { min-height:n.$px${n} }`]),
|
|
84
|
+
nativeClasses: (n='') => ([`Ymin${n}: style['Ymin${n}']`]),
|
|
85
|
+
nativeStyle: (n='') => ([`Ymin${n}: { minHeight:${n} }`])
|
|
86
|
+
}
|
|
87
|
+
export const Ymax = {
|
|
88
|
+
target: `fixed`,
|
|
89
|
+
write: (n='') => ([`Ymax${n}`]),
|
|
90
|
+
webClasses: (n='') => ([`Ymax${n}: 'Ymax${n}'`]),
|
|
91
|
+
webStyle: (n='') => ([`.Ymax${n} { max-height:n.$px${n} }`]),
|
|
92
|
+
nativeClasses: (n='') => ([`Ymax${n}: style['Ymax${n}']`]),
|
|
93
|
+
nativeStyle: (n='') => ([`Ymax${n}: { maxHeight:${n} }`])
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const Xr = {
|
|
97
|
+
target: `fixed`,
|
|
98
|
+
write: () => ([`Xr`]),
|
|
99
|
+
webClasses: () => ([`Xr: 'Xr'`]),
|
|
100
|
+
webStyle: () => ([`.Xr { flex:1 }`]),
|
|
101
|
+
nativeClasses: () => ([`Xr: style['Xr']`]),
|
|
102
|
+
nativeStyle: () => ([`Xr: { flex:1 }`])
|
|
103
|
+
}
|
|
104
|
+
export const Xc = {
|
|
105
|
+
target: `fixed`,
|
|
106
|
+
write: () => ([`Xc`]),
|
|
107
|
+
webClasses: () => ([`Xc: 'Xc'`]),
|
|
108
|
+
webStyle: () => ([`.Xc { align-self:stretch }`]),
|
|
109
|
+
nativeClasses: () => ([`Xc: style['Xc']`]),
|
|
110
|
+
nativeStyle: () => ([`Xc: { alignSelf:'stretch' }`])
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const Yr = {
|
|
114
|
+
target: `fixed`,
|
|
115
|
+
write: () => ([`Yr`]),
|
|
116
|
+
webClasses: () => ([`Yr: 'Yr'`]),
|
|
117
|
+
webStyle: () => ([`.Yr { align-self:stretch }`]),
|
|
118
|
+
nativeClasses: () => ([`Yr: style['Yr']`]),
|
|
119
|
+
nativeStyle: () => ([`Yr: { alignSelf:'stretch' }`])
|
|
120
|
+
}
|
|
121
|
+
export const Yc = {
|
|
122
|
+
target: `fixed`,
|
|
123
|
+
write: () => ([`Yc`]),
|
|
124
|
+
webClasses: () => ([`Yc: 'Yc'`]),
|
|
125
|
+
webStyle: () => ([`.Yc { flex:1; height:1px }`]),
|
|
126
|
+
nativeClasses: () => ([`Yc: style['Yc']`]),
|
|
127
|
+
nativeStyle: () => ([`Yc: { flex:1, height:1 }`])
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const XYr = {
|
|
131
|
+
target: `fixed`,
|
|
132
|
+
write: () => ([`XYr`]),
|
|
133
|
+
webClasses: () => ([`XYr: 'XYr'`]),
|
|
134
|
+
webStyle: () => ([`.XYr { flex:1; align-self:stretch }`]),
|
|
135
|
+
nativeClasses: () => ([`XYr: style['XYr']`]),
|
|
136
|
+
nativeStyle: () => ([`XYr: { flex:1, alignSelf:'stretch' }`])
|
|
137
|
+
}
|
|
138
|
+
export const XYc = {
|
|
139
|
+
target: `fixed`,
|
|
140
|
+
write: () => ([`XYc`]),
|
|
141
|
+
webClasses: () => ([`XYc: 'XYc'`]),
|
|
142
|
+
webStyle: () => ([`.XYc { align-self:stretch; flex:1; height:1px }`]),
|
|
143
|
+
nativeClasses: () => ([`XYc: style['XYc']`]),
|
|
144
|
+
nativeStyle: () => ([`XYc: { alignSelf:'stretch', flex:1, height:1 }`])
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export const G = {
|
|
148
|
+
target: `fixed`,
|
|
149
|
+
write: (n='') => ([`G${n}`]),
|
|
150
|
+
webClasses: (n) => ([`G${n}: 'G${n}'`]),
|
|
151
|
+
webStyle: (n) => ([`.G${n} { flex-grow:${n} }`]),
|
|
152
|
+
nativeClasses: (n) => ([`G${n}: style['G${n}']`]),
|
|
153
|
+
nativeStyle: (n) => ([`G${n}: { flexGrow:${n} }`])
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export const XG = {
|
|
157
|
+
target: `fixed`,
|
|
158
|
+
write: (n='') => ([`XG${n}`]),
|
|
159
|
+
webClasses: (n) => ([`XG${n}: 'XG${n}'`]),
|
|
160
|
+
webStyle: (n) => ([`.XG${n} { flex-grow:${n}; width:1px }`]),
|
|
161
|
+
nativeClasses: (n) => ([`XG${n}: style['XG${n}']`]),
|
|
162
|
+
nativeStyle: (n) => ([`XG${n}: { flexGrow:${n}, width:1 }`])
|
|
163
|
+
}
|
|
164
|
+
|