css-in-props 3.14.1 → 3.14.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/CHANGELOG.md +37 -0
- package/dist/cjs/index.js +1 -38
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/src/index.js +1 -0
- package/dist/cjs/src/props/animation.js +1 -0
- package/dist/cjs/src/props/block.js +1 -0
- package/dist/cjs/src/props/defaults.js +1 -0
- package/dist/cjs/src/props/flex.js +1 -0
- package/dist/cjs/src/props/font.js +1 -0
- package/dist/cjs/src/props/grid.js +1 -0
- package/dist/cjs/src/props/index.js +1 -0
- package/dist/cjs/src/props/misc.js +1 -0
- package/dist/cjs/src/props/position.js +1 -0
- package/dist/cjs/src/props/theme.js +1 -0
- package/dist/cjs/src/props/timing.js +1 -0
- package/dist/cjs/src/set.js +1 -0
- package/dist/cjs/src/transform/executors.js +1 -0
- package/dist/cjs/src/transform/index.js +1 -0
- package/dist/cjs/src/transform/transformers.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/src/index.js +1 -0
- package/dist/esm/src/props/animation.js +1 -0
- package/dist/esm/src/props/block.js +1 -0
- package/dist/esm/src/props/defaults.js +1 -0
- package/dist/esm/src/props/flex.js +1 -0
- package/dist/esm/src/props/font.js +1 -0
- package/dist/esm/src/props/grid.js +1 -0
- package/dist/esm/src/props/index.js +1 -0
- package/dist/esm/src/props/misc.js +1 -0
- package/dist/esm/src/props/position.js +1 -0
- package/dist/esm/src/props/theme.js +1 -0
- package/dist/esm/src/props/timing.js +1 -0
- package/dist/esm/src/set.js +1 -0
- package/dist/esm/src/transform/executors.js +1 -0
- package/dist/esm/src/transform/index.js +1 -0
- package/dist/esm/src/transform/transformers.js +1 -0
- package/package.json +19 -20
- package/dist/cjs/defaults.js +0 -340
- package/dist/cjs/emotion.js +0 -29
- package/dist/cjs/props/animation.js +0 -57
- package/dist/cjs/props/block.js +0 -167
- package/dist/cjs/props/font.js +0 -37
- package/dist/cjs/props/index.js +0 -24
- package/dist/cjs/props/misc.js +0 -36
- package/dist/cjs/props/position.js +0 -54
- package/dist/cjs/props/theme.js +0 -147
- package/dist/cjs/props/timing.js +0 -42
- package/dist/cjs/registry.js +0 -39
- package/dist/cjs/set.js +0 -29
- package/dist/cjs/transform.js +0 -80
- package/index.js +0 -1
- package/src/index.js +0 -6
- package/src/props/animation.js +0 -119
- package/src/props/block.js +0 -183
- package/src/props/defaults.js +0 -318
- package/src/props/flex.js +0 -30
- package/src/props/font.js +0 -16
- package/src/props/grid.js +0 -21
- package/src/props/index.js +0 -35
- package/src/props/misc.js +0 -23
- package/src/props/position.js +0 -34
- package/src/props/theme.js +0 -155
- package/src/props/timing.js +0 -26
- package/src/set.js +0 -16
- package/src/transform/executors.js +0 -123
- package/src/transform/index.js +0 -4
- package/src/transform/transformers.js +0 -178
package/src/props/block.js
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { isUndefined, isString } from '@symbo.ls/utils'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
getSpacingBasedOnRatio,
|
|
7
|
-
transformSize,
|
|
8
|
-
transformBorderRadius,
|
|
9
|
-
transformSizeRatio,
|
|
10
|
-
transfromGap
|
|
11
|
-
} from '@symbo.ls/scratch'
|
|
12
|
-
|
|
13
|
-
export const BLOCK_PROPS = {
|
|
14
|
-
show: (val) => !val ? ({ display: 'none !important' }) : undefined,
|
|
15
|
-
|
|
16
|
-
hide: (val) => val ? ({ display: 'none !important' }) : undefined,
|
|
17
|
-
|
|
18
|
-
height: (val, el) => transformSizeRatio('height', val, el),
|
|
19
|
-
width: (val, el) => transformSizeRatio('width', val, el),
|
|
20
|
-
|
|
21
|
-
boxSizing: (val) => !isUndefined(val)
|
|
22
|
-
? ({ boxSizing: val })
|
|
23
|
-
: { boxSizing: 'border-box' },
|
|
24
|
-
|
|
25
|
-
boxSize: (val) => {
|
|
26
|
-
if (!isString(val)) return
|
|
27
|
-
const [height, width] = val.split(' ')
|
|
28
|
-
return {
|
|
29
|
-
...transformSize('height', height),
|
|
30
|
-
...transformSize('width', width || height)
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
inlineSize: (val, el) => transformSizeRatio('inlineSize', val, el),
|
|
35
|
-
blockSize: (val, el) => transformSizeRatio('blockSize', val, el),
|
|
36
|
-
|
|
37
|
-
minWidth: (val, el) => transformSizeRatio('minWidth', val, el),
|
|
38
|
-
maxWidth: (val, el) => transformSizeRatio('maxWidth', val, el),
|
|
39
|
-
widthRange: (val) => {
|
|
40
|
-
if (!isString(val)) return
|
|
41
|
-
const [minWidth, maxWidth] = val.split(' ')
|
|
42
|
-
return {
|
|
43
|
-
...transformSize('minWidth', minWidth),
|
|
44
|
-
...transformSize('maxWidth', maxWidth || minWidth)
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
minHeight: (val, el) => transformSizeRatio('minHeight', val, el),
|
|
49
|
-
maxHeight: (val, el) => transformSizeRatio('maxHeight', val, el),
|
|
50
|
-
heightRange: (val) => {
|
|
51
|
-
if (!isString(val)) return
|
|
52
|
-
const [minHeight, maxHeight] = val.split(' ')
|
|
53
|
-
return {
|
|
54
|
-
...transformSize('minHeight', minHeight),
|
|
55
|
-
...transformSize('maxHeight', maxHeight || minHeight)
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
size: (val) => {
|
|
60
|
-
if (!isString(val)) return
|
|
61
|
-
const [inlineSize, blockSize] = val.split(' ')
|
|
62
|
-
return {
|
|
63
|
-
...transformSizeRatio('inlineSize', inlineSize),
|
|
64
|
-
...transformSizeRatio('blockSize', blockSize || inlineSize)
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
minBlockSize: (val, el) => transformSizeRatio('minBlockSize', val, el),
|
|
69
|
-
minInlineSize: (val, el) => transformSizeRatio('minInlineSize', val, el),
|
|
70
|
-
|
|
71
|
-
maxBlockSize: (val, el) => transformSizeRatio('maxBlockSize', val, el),
|
|
72
|
-
maxInlineSize: (val, el) => transformSizeRatio('maxInlineSize', val, el),
|
|
73
|
-
|
|
74
|
-
minSize: (val) => {
|
|
75
|
-
if (!isString(val)) return
|
|
76
|
-
const [minInlineSize, minBlockSize] = val.split(' ')
|
|
77
|
-
return {
|
|
78
|
-
...transformSize('minInlineSize', minInlineSize),
|
|
79
|
-
...transformSize('minBlockSize', minBlockSize || minInlineSize)
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
maxSize: (val) => {
|
|
84
|
-
if (!isString(val)) return
|
|
85
|
-
const [maxInlineSize, maxBlockSize] = val.split(' ')
|
|
86
|
-
return {
|
|
87
|
-
...transformSize('maxInlineSize', maxInlineSize),
|
|
88
|
-
...transformSize('maxBlockSize', maxBlockSize || maxInlineSize)
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
borderWidth: (val, el) => transformSizeRatio('borderWidth', val, el),
|
|
93
|
-
|
|
94
|
-
padding: (val, el) => transformSizeRatio('padding', val, el),
|
|
95
|
-
scrollPadding: (val, el) => transformSizeRatio('scrollPadding', val, el),
|
|
96
|
-
paddingInline: (val) => {
|
|
97
|
-
if (!isString(val)) return
|
|
98
|
-
const [paddingInlineStart, paddingInlineEnd] = val.split(' ')
|
|
99
|
-
return {
|
|
100
|
-
...transformSize('paddingInlineStart', paddingInlineStart),
|
|
101
|
-
...transformSize('paddingInlineEnd', paddingInlineEnd || paddingInlineStart)
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
paddingBlock: (val) => {
|
|
105
|
-
if (!isString(val)) return
|
|
106
|
-
const [paddingBlockStart, paddingBlockEnd] = val.split(' ')
|
|
107
|
-
return {
|
|
108
|
-
...transformSize('paddingBlockStart', paddingBlockStart),
|
|
109
|
-
...transformSize('paddingBlockEnd', paddingBlockEnd || paddingBlockStart)
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
paddingTop: (val, el) => transformSizeRatio('paddingBlockStart', val, el),
|
|
113
|
-
paddingBottom: (val, el) => transformSizeRatio('paddingBlockEnd', val, el),
|
|
114
|
-
paddingLeft: (val, el) => transformSizeRatio('paddingInlineStart', val, el),
|
|
115
|
-
paddingRight: (val, el) => transformSizeRatio('paddingInlineEnd', val, el),
|
|
116
|
-
|
|
117
|
-
paddingBlockStart: (val, el) => transformSizeRatio('paddingBlockStart', val, el),
|
|
118
|
-
paddingBlockEnd: (val, el) => transformSizeRatio('paddingBlockEnd', val, el),
|
|
119
|
-
paddingInlineStart: (val, el) => transformSizeRatio('paddingInlineStart', val, el),
|
|
120
|
-
paddingInlineEnd: (val, el) => transformSizeRatio('paddingInlineEnd', val, el),
|
|
121
|
-
|
|
122
|
-
margin: (val, el) => transformSizeRatio('margin', val, el),
|
|
123
|
-
marginInline: (val) => {
|
|
124
|
-
if (!isString(val)) return
|
|
125
|
-
const [marginInlineStart, marginInlineEnd] = val.split(' ')
|
|
126
|
-
return {
|
|
127
|
-
...transformSize('marginInlineStart', marginInlineStart),
|
|
128
|
-
...transformSize('marginInlineEnd', marginInlineEnd || marginInlineStart)
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
marginBlock: (val, el) => {
|
|
132
|
-
if (!isString(el.marginBlock)) return
|
|
133
|
-
const [marginBlockStart, marginBlockEnd] = el.marginBlock.split(' ')
|
|
134
|
-
return {
|
|
135
|
-
...transformSize('marginBlockStart', marginBlockStart),
|
|
136
|
-
...transformSize('marginBlockEnd', marginBlockEnd || marginBlockStart)
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
marginTop: (val, el) => transformSizeRatio('marginBlockStart', val, el),
|
|
140
|
-
marginBottom: (val, el) => transformSizeRatio('marginBlockEnd', val, el),
|
|
141
|
-
marginLeft: (val, el) => transformSizeRatio('marginInlineStart', val, el),
|
|
142
|
-
marginRight: (val, el) => transformSizeRatio('marginInlineEnd', val, el),
|
|
143
|
-
|
|
144
|
-
marginInlineStart: (val, el) => transformSizeRatio('marginInlineStart', val, el),
|
|
145
|
-
marginInlineEnd: (val, el) => transformSizeRatio('marginInlineEnd', val, el),
|
|
146
|
-
marginBlockStart: (val, el) => transformSizeRatio('marginBlockStart', val, el),
|
|
147
|
-
marginBlockEnd: (val, el) => transformSizeRatio('marginBlockEnd', val, el),
|
|
148
|
-
|
|
149
|
-
gap: (val) => ({
|
|
150
|
-
gap: transfromGap(val)
|
|
151
|
-
}),
|
|
152
|
-
|
|
153
|
-
columnGap: (val, el) => getSpacingBasedOnRatio(el, 'columnGap', val),
|
|
154
|
-
rowGap: (val, el) => getSpacingBasedOnRatio(el, 'rowGap', val),
|
|
155
|
-
|
|
156
|
-
flexWrap: (val) => ({
|
|
157
|
-
display: 'flex',
|
|
158
|
-
flexWrap: val
|
|
159
|
-
}),
|
|
160
|
-
flexFlow: (val, el) => {
|
|
161
|
-
const reverse = el.reverse
|
|
162
|
-
if (!isString(val)) return
|
|
163
|
-
let [direction, wrap] = (val || 'row').split(' ')
|
|
164
|
-
if (val.startsWith('x') || val === 'row') direction = 'row'
|
|
165
|
-
if (val.startsWith('y') || val === 'column') direction = 'column'
|
|
166
|
-
return {
|
|
167
|
-
display: 'flex',
|
|
168
|
-
flexFlow: (direction || '') + (!direction.includes('-reverse') && reverse ? '-reverse' : '') + ' ' + (wrap || '')
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
flexAlign: (val) => {
|
|
172
|
-
if (!isString(val)) return
|
|
173
|
-
const [alignItems, justifyContent] = val.split(' ')
|
|
174
|
-
return {
|
|
175
|
-
display: 'flex',
|
|
176
|
-
alignItems,
|
|
177
|
-
justifyContent
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
round: (val, el) => transformBorderRadius(val ?? el.borderRadius, el, 'round'),
|
|
182
|
-
borderRadius: (val, el) => transformBorderRadius(val ?? el.round, el, 'borderRadius')
|
|
183
|
-
}
|
package/src/props/defaults.js
DELETED
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_CSS_PROPERTIES_LIST = new Set([
|
|
2
|
-
'accentColor',
|
|
3
|
-
'alignContent',
|
|
4
|
-
'alignItems',
|
|
5
|
-
'alignSelf',
|
|
6
|
-
'alignmentBaseline',
|
|
7
|
-
'all',
|
|
8
|
-
'animation',
|
|
9
|
-
'animationDelay',
|
|
10
|
-
'animationDirection',
|
|
11
|
-
'animationDuration',
|
|
12
|
-
'animationFillMode',
|
|
13
|
-
'animationIterationCount',
|
|
14
|
-
'animationName',
|
|
15
|
-
'animationPlayState',
|
|
16
|
-
'animationTimingFunction',
|
|
17
|
-
'appearance',
|
|
18
|
-
'aspectRatio',
|
|
19
|
-
'backdropFilter',
|
|
20
|
-
'backfaceVisibility',
|
|
21
|
-
'background',
|
|
22
|
-
'backgroundAttachment',
|
|
23
|
-
'backgroundBlendMode',
|
|
24
|
-
'backgroundClip',
|
|
25
|
-
'backgroundColor',
|
|
26
|
-
'backgroundImage',
|
|
27
|
-
'backgroundOrigin',
|
|
28
|
-
'backgroundPosition',
|
|
29
|
-
'backgroundPositionX',
|
|
30
|
-
'backgroundPositionY',
|
|
31
|
-
'backgroundRepeat',
|
|
32
|
-
'backgroundRepeatX',
|
|
33
|
-
'backgroundRepeatY',
|
|
34
|
-
'backgroundSize',
|
|
35
|
-
'baselineShift',
|
|
36
|
-
'blockSize',
|
|
37
|
-
'border',
|
|
38
|
-
'borderBlock',
|
|
39
|
-
'borderBlockColor',
|
|
40
|
-
'borderBlockEnd',
|
|
41
|
-
'borderBlockEndColor',
|
|
42
|
-
'borderBlockEndStyle',
|
|
43
|
-
'borderBlockEndWidth',
|
|
44
|
-
'borderBlockStart',
|
|
45
|
-
'borderBlockStartColor',
|
|
46
|
-
'borderBlockStartStyle',
|
|
47
|
-
'borderBlockStartWidth',
|
|
48
|
-
'borderBlockStyle',
|
|
49
|
-
'borderBlockWidth',
|
|
50
|
-
'borderBottom',
|
|
51
|
-
'borderBottomColor',
|
|
52
|
-
'borderBottomLeftRadius',
|
|
53
|
-
'borderBottomRightRadius',
|
|
54
|
-
'borderBottomStyle',
|
|
55
|
-
'borderBottomWidth',
|
|
56
|
-
'borderCollapse',
|
|
57
|
-
'borderColor',
|
|
58
|
-
'borderImage',
|
|
59
|
-
'borderImageOutset',
|
|
60
|
-
'borderImageRepeat',
|
|
61
|
-
'borderImageSlice',
|
|
62
|
-
'borderImageSource',
|
|
63
|
-
'borderImageWidth',
|
|
64
|
-
'borderLeft',
|
|
65
|
-
'borderLeftColor',
|
|
66
|
-
'borderLeftStyle',
|
|
67
|
-
'borderLeftWidth',
|
|
68
|
-
'borderRadius',
|
|
69
|
-
'borderRight',
|
|
70
|
-
'borderRightColor',
|
|
71
|
-
'borderRightStyle',
|
|
72
|
-
'borderRightWidth',
|
|
73
|
-
'borderSpacing',
|
|
74
|
-
'borderStyle',
|
|
75
|
-
'borderTop',
|
|
76
|
-
'borderTopColor',
|
|
77
|
-
'borderTopLeftRadius',
|
|
78
|
-
'borderTopRightRadius',
|
|
79
|
-
'borderTopStyle',
|
|
80
|
-
'borderTopWidth',
|
|
81
|
-
'borderWidth',
|
|
82
|
-
'bottom',
|
|
83
|
-
'boxDecorationBreak',
|
|
84
|
-
'boxShadow',
|
|
85
|
-
'boxSizing',
|
|
86
|
-
'breakAfter',
|
|
87
|
-
'breakBefore',
|
|
88
|
-
'breakInside',
|
|
89
|
-
'captionSide',
|
|
90
|
-
'caretColor',
|
|
91
|
-
'clear',
|
|
92
|
-
'clip',
|
|
93
|
-
'clipPath',
|
|
94
|
-
'color',
|
|
95
|
-
'colorAdjust',
|
|
96
|
-
'colorInterpolation',
|
|
97
|
-
'colorInterpolationFilters',
|
|
98
|
-
'colorRendering',
|
|
99
|
-
'columnCount',
|
|
100
|
-
'columnFill',
|
|
101
|
-
'columnGap',
|
|
102
|
-
'columnRule',
|
|
103
|
-
'columnRuleColor',
|
|
104
|
-
'columnRuleStyle',
|
|
105
|
-
'columnRuleWidth',
|
|
106
|
-
'columnSpan',
|
|
107
|
-
'columnWidth',
|
|
108
|
-
'columns',
|
|
109
|
-
'contain',
|
|
110
|
-
'content',
|
|
111
|
-
'counterIncrement',
|
|
112
|
-
'counterReset',
|
|
113
|
-
'cursor',
|
|
114
|
-
'direction',
|
|
115
|
-
'display',
|
|
116
|
-
'emptyCells',
|
|
117
|
-
'filter',
|
|
118
|
-
'flex',
|
|
119
|
-
'flexBasis',
|
|
120
|
-
'flexDirection',
|
|
121
|
-
'flexFlow',
|
|
122
|
-
'flexGrow',
|
|
123
|
-
'flexShrink',
|
|
124
|
-
'flexWrap',
|
|
125
|
-
'float',
|
|
126
|
-
'font',
|
|
127
|
-
'fontFamily',
|
|
128
|
-
'fontFeatureSettings',
|
|
129
|
-
'fontKerning',
|
|
130
|
-
'fontLanguageOverride',
|
|
131
|
-
'fontSize',
|
|
132
|
-
'fontSizeAdjust',
|
|
133
|
-
'fontStretch',
|
|
134
|
-
'fontStyle',
|
|
135
|
-
'fontVariant',
|
|
136
|
-
'fontVariantAlternates',
|
|
137
|
-
'fontVariantCaps',
|
|
138
|
-
'fontVariantEastAsian',
|
|
139
|
-
'fontVariantNumeric',
|
|
140
|
-
'fontVariantPosition',
|
|
141
|
-
'fontWeight',
|
|
142
|
-
'fontVariationSettings',
|
|
143
|
-
'fontSynthesis',
|
|
144
|
-
'forcedColorAdjust',
|
|
145
|
-
'gap',
|
|
146
|
-
'grid',
|
|
147
|
-
'gridArea',
|
|
148
|
-
'gridAutoColumns',
|
|
149
|
-
'gridAutoFlow',
|
|
150
|
-
'gridAutoRows',
|
|
151
|
-
'gridColumn',
|
|
152
|
-
'gridColumnEnd',
|
|
153
|
-
'gridColumnGap',
|
|
154
|
-
'gridColumnStart',
|
|
155
|
-
'gridGap',
|
|
156
|
-
'gridRow',
|
|
157
|
-
'gridRowEnd',
|
|
158
|
-
'gridRowGap',
|
|
159
|
-
'gridRowStart',
|
|
160
|
-
'gridTemplate',
|
|
161
|
-
'gridTemplateAreas',
|
|
162
|
-
'gridTemplateColumns',
|
|
163
|
-
'gridTemplateRows',
|
|
164
|
-
'height',
|
|
165
|
-
'hyphens',
|
|
166
|
-
'imageOrientation',
|
|
167
|
-
'imageRendering',
|
|
168
|
-
'imeMode',
|
|
169
|
-
'inset',
|
|
170
|
-
'insetBlock',
|
|
171
|
-
'insetBlockEnd',
|
|
172
|
-
'insetBlockStart',
|
|
173
|
-
'insetInline',
|
|
174
|
-
'insetInlineEnd',
|
|
175
|
-
'insetInlineStart',
|
|
176
|
-
'initialLetter',
|
|
177
|
-
'isolation',
|
|
178
|
-
'justifyContent',
|
|
179
|
-
'justifyItems',
|
|
180
|
-
'justifySelf',
|
|
181
|
-
'left',
|
|
182
|
-
'letterSpacing',
|
|
183
|
-
'lineBreak',
|
|
184
|
-
'lineClamp',
|
|
185
|
-
'lineHeight',
|
|
186
|
-
'listStyle',
|
|
187
|
-
'listStyleImage',
|
|
188
|
-
'listStylePosition',
|
|
189
|
-
'listStyleType',
|
|
190
|
-
'margin',
|
|
191
|
-
'marginBottom',
|
|
192
|
-
'marginLeft',
|
|
193
|
-
'marginRight',
|
|
194
|
-
'marginTop',
|
|
195
|
-
'marginBlock',
|
|
196
|
-
'marginBlockEnd',
|
|
197
|
-
'marginBlockStart',
|
|
198
|
-
'marginInline',
|
|
199
|
-
'marginInlineEnd',
|
|
200
|
-
'marginInlineStart',
|
|
201
|
-
'mask',
|
|
202
|
-
'maskBorder',
|
|
203
|
-
'maskBorderImage',
|
|
204
|
-
'maskBorderOutset',
|
|
205
|
-
'maskBorderRepeat',
|
|
206
|
-
'maskBorderSlice',
|
|
207
|
-
'maskBorderSource',
|
|
208
|
-
'maskBorderWidth',
|
|
209
|
-
'maskClip',
|
|
210
|
-
'maskComposite',
|
|
211
|
-
'maskImage',
|
|
212
|
-
'maskOrigin',
|
|
213
|
-
'maskPosition',
|
|
214
|
-
'maskRepeat',
|
|
215
|
-
'maskSize',
|
|
216
|
-
'maskType',
|
|
217
|
-
'maxBlockSize',
|
|
218
|
-
'maxHeight',
|
|
219
|
-
'maxInlineSize',
|
|
220
|
-
'maxWidth',
|
|
221
|
-
'minBlockSize',
|
|
222
|
-
'minHeight',
|
|
223
|
-
'minInlineSize',
|
|
224
|
-
'minWidth',
|
|
225
|
-
'mixBlendMode',
|
|
226
|
-
'objectFit',
|
|
227
|
-
'objectPosition',
|
|
228
|
-
'objectViewBox',
|
|
229
|
-
'offset',
|
|
230
|
-
'offsetDistance',
|
|
231
|
-
'offsetPath',
|
|
232
|
-
'offsetRotate',
|
|
233
|
-
'opacity',
|
|
234
|
-
'order',
|
|
235
|
-
'orientation',
|
|
236
|
-
'outline',
|
|
237
|
-
'outlineColor',
|
|
238
|
-
'outlineOffset',
|
|
239
|
-
'outlineStyle',
|
|
240
|
-
'outlineWidth',
|
|
241
|
-
'overflow',
|
|
242
|
-
'overflowAnchor',
|
|
243
|
-
'overflowClip',
|
|
244
|
-
'overflowScrolling',
|
|
245
|
-
'overflowWrap',
|
|
246
|
-
'overflowX',
|
|
247
|
-
'overflowY',
|
|
248
|
-
'padding',
|
|
249
|
-
'paddingBottom',
|
|
250
|
-
'paddingLeft',
|
|
251
|
-
'paddingRight',
|
|
252
|
-
'paddingTop',
|
|
253
|
-
'pageBreakAfter',
|
|
254
|
-
'pageBreakBefore',
|
|
255
|
-
'pageBreakInside',
|
|
256
|
-
'paintOrder',
|
|
257
|
-
'perspective',
|
|
258
|
-
'perspectiveOrigin',
|
|
259
|
-
'placeContent',
|
|
260
|
-
'placeItems',
|
|
261
|
-
'placeSelf',
|
|
262
|
-
'pointerEvents',
|
|
263
|
-
'position',
|
|
264
|
-
'resize',
|
|
265
|
-
'right',
|
|
266
|
-
'rotate',
|
|
267
|
-
'rowGap',
|
|
268
|
-
'scrollBehavior',
|
|
269
|
-
'scrollPadding',
|
|
270
|
-
'scrollSnapAlign',
|
|
271
|
-
'scrollSnapType',
|
|
272
|
-
'scrollbarColor',
|
|
273
|
-
'scrollbarWidth',
|
|
274
|
-
'shapeImageThreshold',
|
|
275
|
-
'shapeMargin',
|
|
276
|
-
'shapeOutside',
|
|
277
|
-
'tabSize',
|
|
278
|
-
'tableLayout',
|
|
279
|
-
'textAlign',
|
|
280
|
-
'textAlignLast',
|
|
281
|
-
'textDecoration',
|
|
282
|
-
'textDecorationColor',
|
|
283
|
-
'textDecorationLine',
|
|
284
|
-
'textDecorationSkipInk',
|
|
285
|
-
'textDecorationStyle',
|
|
286
|
-
'textDecorationThickness',
|
|
287
|
-
'textIndent',
|
|
288
|
-
'textOverflow',
|
|
289
|
-
'textShadow',
|
|
290
|
-
'textTransform',
|
|
291
|
-
'textUnderlineOffset',
|
|
292
|
-
'top',
|
|
293
|
-
'transform',
|
|
294
|
-
'transformOrigin',
|
|
295
|
-
'transformStyle',
|
|
296
|
-
'transition',
|
|
297
|
-
'transitionDelay',
|
|
298
|
-
'transitionDuration',
|
|
299
|
-
'transitionProperty',
|
|
300
|
-
'transitionTimingFunction',
|
|
301
|
-
'translate',
|
|
302
|
-
'translateX',
|
|
303
|
-
'translateY',
|
|
304
|
-
'translateZ',
|
|
305
|
-
'unicodeBidi',
|
|
306
|
-
'userSelect',
|
|
307
|
-
'verticalAlign',
|
|
308
|
-
'visibility',
|
|
309
|
-
'whiteSpace',
|
|
310
|
-
'widows',
|
|
311
|
-
'width',
|
|
312
|
-
'willChange',
|
|
313
|
-
'wordBreak',
|
|
314
|
-
'wordSpacing',
|
|
315
|
-
'wordWrap',
|
|
316
|
-
'writingMode',
|
|
317
|
-
'zIndex'
|
|
318
|
-
])
|
package/src/props/flex.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { isString } from '@symbo.ls/utils'
|
|
4
|
-
|
|
5
|
-
export const FLEX_PROPS = {
|
|
6
|
-
flow: (value, el) => {
|
|
7
|
-
const reverse = el.reverse
|
|
8
|
-
if (!isString(value)) return
|
|
9
|
-
let [direction, wrap] = (value || 'row').split(' ')
|
|
10
|
-
if (value.startsWith('x') || value === 'row') direction = 'row'
|
|
11
|
-
if (value.startsWith('y') || value === 'column') direction = 'column'
|
|
12
|
-
return {
|
|
13
|
-
display: 'flex',
|
|
14
|
-
flexFlow:
|
|
15
|
-
(direction || '') +
|
|
16
|
-
(!direction.includes('-reverse') && reverse ? '-reverse' : '') +
|
|
17
|
-
' ' +
|
|
18
|
-
(wrap || '')
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
wrap: (value, el) => {
|
|
23
|
-
return { display: 'flex', flexWrap: value }
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
align: (value, el) => {
|
|
27
|
-
const [alignItems, justifyContent] = value.split(' ')
|
|
28
|
-
return { display: 'flex', alignItems, justifyContent }
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/props/font.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { getFontSizeByKey, getFontFamily } from '@symbo.ls/scratch'
|
|
4
|
-
|
|
5
|
-
export const FONT_PROPS = {
|
|
6
|
-
fontSize: (value) => {
|
|
7
|
-
return getFontSizeByKey(value) || value
|
|
8
|
-
},
|
|
9
|
-
fontFamily: (value) => ({
|
|
10
|
-
fontFamily: getFontFamily(value) || value
|
|
11
|
-
}),
|
|
12
|
-
fontWeight: (value) => ({
|
|
13
|
-
fontWeight: value,
|
|
14
|
-
fontVariationSettings: '"wght" ' + value
|
|
15
|
-
})
|
|
16
|
-
}
|
package/src/props/grid.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export const GRID_PROPS = {
|
|
4
|
-
area: (value) => ({ gridArea: value }),
|
|
5
|
-
template: (value) => ({ gridTemplate: value }),
|
|
6
|
-
templateAreas: (value) => ({ gridTemplateAreas: value }),
|
|
7
|
-
|
|
8
|
-
column: (value) => ({ gridColumn: value }),
|
|
9
|
-
columns: (value) => ({ gridTemplateColumns: value }),
|
|
10
|
-
templateColumns: (value) => ({ gridTemplateColumns: value }),
|
|
11
|
-
autoColumns: (value) => ({ gridAutoColumns: value }),
|
|
12
|
-
columnStart: (value) => ({ gridColumnStart: value }),
|
|
13
|
-
|
|
14
|
-
row: (value) => ({ gridRow: value }),
|
|
15
|
-
rows: (value) => ({ gridTemplateRows: value }),
|
|
16
|
-
templateRows: (value) => ({ gridTemplateRows: value }),
|
|
17
|
-
autoRows: (value) => ({ gridAutoRows: value }),
|
|
18
|
-
rowStart: (value) => ({ gridRowStart: value }),
|
|
19
|
-
|
|
20
|
-
autoFlow: (value) => ({ gridAutoFlow: value })
|
|
21
|
-
}
|
package/src/props/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { ANIMATION_PROPS } from './animation.js'
|
|
4
|
-
import { BLOCK_PROPS } from './block.js'
|
|
5
|
-
import { FONT_PROPS } from './font.js'
|
|
6
|
-
import { MISC_PROPS } from './misc.js'
|
|
7
|
-
import { POSITION_PROPS } from './position.js'
|
|
8
|
-
import { THEME_PROPS } from './theme.js'
|
|
9
|
-
import { TIMING_PROPS } from './timing.js'
|
|
10
|
-
import { FLEX_PROPS } from './flex.js'
|
|
11
|
-
import { GRID_PROPS } from './grid.js'
|
|
12
|
-
|
|
13
|
-
export * from './animation.js'
|
|
14
|
-
export * from './block.js'
|
|
15
|
-
export * from './font.js'
|
|
16
|
-
export * from './misc.js'
|
|
17
|
-
export * from './position.js'
|
|
18
|
-
export * from './theme.js'
|
|
19
|
-
export * from './timing.js'
|
|
20
|
-
export * from './flex.js'
|
|
21
|
-
export * from './grid.js'
|
|
22
|
-
|
|
23
|
-
export const CSS_PROPS_REGISTRY = {
|
|
24
|
-
...ANIMATION_PROPS,
|
|
25
|
-
...BLOCK_PROPS,
|
|
26
|
-
...FONT_PROPS,
|
|
27
|
-
...MISC_PROPS,
|
|
28
|
-
...POSITION_PROPS,
|
|
29
|
-
...THEME_PROPS,
|
|
30
|
-
...TIMING_PROPS,
|
|
31
|
-
...FLEX_PROPS,
|
|
32
|
-
...GRID_PROPS
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default CSS_PROPS_REGISTRY
|
package/src/props/misc.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export const MISC_PROPS = {
|
|
4
|
-
overflow: (value) => ({
|
|
5
|
-
overflow: value,
|
|
6
|
-
scrollBehavior: 'smooth'
|
|
7
|
-
}),
|
|
8
|
-
cursor: (value, el, s, ctx) => {
|
|
9
|
-
if (!value) return
|
|
10
|
-
|
|
11
|
-
const asset = ctx.assets && ctx.assets[value]
|
|
12
|
-
if (asset && asset.content) value = `url(${asset.content.src})`
|
|
13
|
-
else {
|
|
14
|
-
const file = ctx.files && ctx.files[value]
|
|
15
|
-
if (file && file.content) value = `url(${file.content.src})`
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return ({ cursor: value })
|
|
19
|
-
},
|
|
20
|
-
opacity: (value) => value != null ? ({ opacity: String(value) }) : undefined,
|
|
21
|
-
visibility: (value) => value != null ? ({ visibility: value }) : undefined,
|
|
22
|
-
pointerEvents: (value) => value != null ? ({ pointerEvents: value }) : undefined
|
|
23
|
-
}
|
package/src/props/position.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { getSpacingByKey } from '@symbo.ls/scratch'
|
|
4
|
-
|
|
5
|
-
export const POSITION_PROPS = {
|
|
6
|
-
inset: (val, el) => {
|
|
7
|
-
if (el.call('isNumber', val)) return ({ inset: val })
|
|
8
|
-
if (!el.call('isString', val)) return
|
|
9
|
-
return { inset: val.split(' ').map(v => getSpacingByKey(v, 'k').k).join(' ') }
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
left: (val) => getSpacingByKey(val, 'left'),
|
|
13
|
-
top: (val) => getSpacingByKey(val, 'top'),
|
|
14
|
-
right: (val) => getSpacingByKey(val, 'right'),
|
|
15
|
-
bottom: (val) => getSpacingByKey(val, 'bottom'),
|
|
16
|
-
|
|
17
|
-
verticalInset: (val) => {
|
|
18
|
-
if (typeof val !== 'string') return
|
|
19
|
-
const vi = val.split(' ').map(v => getSpacingByKey(v, 'k').k)
|
|
20
|
-
return {
|
|
21
|
-
top: vi[0],
|
|
22
|
-
bottom: vi[1] || vi[0]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
horizontalInset: (val) => {
|
|
27
|
-
if (typeof val !== 'string') return
|
|
28
|
-
const vi = val.split(' ').map(v => getSpacingByKey(v, 'k').k)
|
|
29
|
-
return {
|
|
30
|
-
left: vi[0],
|
|
31
|
-
right: vi[1] || vi[0]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|