@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,140 @@
|
|
|
1
|
+
export const margin = {
|
|
2
|
+
target: `fixed`,
|
|
3
|
+
write: (n='') => ([`margin${n}`]),
|
|
4
|
+
webClasses: (n) => ([`margin${n}: 'margin${n}'`]),
|
|
5
|
+
webStyle: (n) => ([`.margin${n} { margin:n.$px${n} }`]),
|
|
6
|
+
nativeClasses: (n) => ([`margin${n}: style['margin${n}']`]),
|
|
7
|
+
nativeStyle: (n) => ([`margin${n}: { margin:${n} }`])
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const marginX = {
|
|
11
|
+
target: `fixed`,
|
|
12
|
+
write: (n='') => ([`marginX${n}`]),
|
|
13
|
+
webClasses: (n) => ([`marginX${n}: 'marginX${n}'`]),
|
|
14
|
+
webStyle: (n) => ([`.marginX${n} { margin-left:n.$px${n}; margin-right:n.$px${n} }`]),
|
|
15
|
+
nativeClasses: (n) => ([`marginX${n}: style['marginX${n}']`]),
|
|
16
|
+
nativeStyle: (n) => ([`marginX${n}: { marginLeft:${n}, marginRight:${n}}`])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const marginY = {
|
|
20
|
+
target: `fixed`,
|
|
21
|
+
write: (n='') => ([`marginY${n}`]),
|
|
22
|
+
webClasses: (n) => ([`marginY${n}: 'marginY${n}'`]),
|
|
23
|
+
webStyle: (n) => ([`.marginY${n} { margin-top:n.$px${n}; margin-bottom:n.$px${n} }`]),
|
|
24
|
+
nativeClasses: (n) => ([`marginY${n}: style['marginY${n}']`]),
|
|
25
|
+
nativeStyle: (n) => ([`marginY${n}: { marginTop:${n}, marginBottom:${n}}`])
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const marginT = {
|
|
29
|
+
target: `fixed`,
|
|
30
|
+
write: (n='') => ([`marginT${n}`]),
|
|
31
|
+
webClasses: (n) => ([`marginT${n}: 'marginT${n}'`]),
|
|
32
|
+
webStyle: (n) => ([`.marginT${n} { margin-top:n.$px${n} }`]),
|
|
33
|
+
nativeClasses: (n) => ([`marginT${n}: style['marginT${n}']`]),
|
|
34
|
+
nativeStyle: (n) => ([`marginT${n}: { marginTop:${n} }`])
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const marginB = {
|
|
38
|
+
target: `fixed`,
|
|
39
|
+
write: (n='') => ([`marginB${n}`]),
|
|
40
|
+
webClasses: (n) => ([`marginB${n}: 'marginB${n}'`]),
|
|
41
|
+
webStyle: (n) => ([`.marginB${n} { margin-bottom:n.$px${n} }`]),
|
|
42
|
+
nativeClasses: (n) => ([`marginB${n}: style['marginB${n}']`]),
|
|
43
|
+
nativeStyle: (n) => ([`marginB${n}: { marginBottom:${n}}`])
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const marginS = {
|
|
47
|
+
target: `directional`,
|
|
48
|
+
write: (n='') => ([
|
|
49
|
+
`marginS${n}`,
|
|
50
|
+
`marginE${n}`
|
|
51
|
+
]),
|
|
52
|
+
webClasses: (n) => ([
|
|
53
|
+
`marginS${n}: isRTL ? 'marginR${n}' : 'marginL${n}'`,
|
|
54
|
+
`marginE${n}: isRTL ? 'marginL${n}' : 'marginR${n}'`
|
|
55
|
+
]),
|
|
56
|
+
webStyle: (n) => ([
|
|
57
|
+
`.marginL${n} { margin-left:n.$px${n} }`,
|
|
58
|
+
`.marginR${n} { margin-right:n.$px${n} }`
|
|
59
|
+
]),
|
|
60
|
+
nativeClasses: (n) => ([
|
|
61
|
+
`marginS${n}: style[isRTL ? 'marginR${n}' : 'marginL${n}']`,
|
|
62
|
+
`marginE${n}: style[isRTL ? 'marginL${n}' : 'marginR${n}']`
|
|
63
|
+
]),
|
|
64
|
+
nativeStyle: (n) => ([
|
|
65
|
+
`marginL${n}: { marginLeft:${n} }`,
|
|
66
|
+
`marginR${n}: { marginRight:${n} }`
|
|
67
|
+
])
|
|
68
|
+
}
|
|
69
|
+
export const marginE = marginS
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
export const padding = {
|
|
73
|
+
target: `fixed`,
|
|
74
|
+
write: (n='') => ([`padding${n}`]),
|
|
75
|
+
webClasses: (n) => ([`padding${n}: 'padding${n}'`]),
|
|
76
|
+
webStyle: (n) => ([`.padding${n} { padding:n.$px${n} }`]),
|
|
77
|
+
nativeClasses: (n) => ([`padding${n}: style['padding${n}']`]),
|
|
78
|
+
nativeStyle: (n) => ([`padding${n}: { padding:${n} }`])
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const paddingX = {
|
|
82
|
+
target: `fixed`,
|
|
83
|
+
write: (n='') => ([`paddingX${n}`]),
|
|
84
|
+
webClasses: (n) => ([`paddingX${n}: 'paddingX${n}'`]),
|
|
85
|
+
webStyle: (n) => ([`.paddingX${n} { padding-left:n.$px${n}; padding-right:n.$px${n} }`]),
|
|
86
|
+
nativeClasses: (n) => ([`paddingX${n}: style['paddingX${n}']`]),
|
|
87
|
+
nativeStyle: (n) => ([`paddingX${n}: { paddingLeft:${n}, paddingRight:${n}}`])
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const paddingY = {
|
|
91
|
+
target: `fixed`,
|
|
92
|
+
write: (n='') => ([`paddingY${n}`]),
|
|
93
|
+
webClasses: (n) => ([`paddingY${n}: 'paddingY${n}'`]),
|
|
94
|
+
webStyle: (n) => ([`.paddingY${n} { padding-top:n.$px${n}; padding-bottom:n.$px${n} }`]),
|
|
95
|
+
nativeClasses: (n) => ([`paddingY${n}: style['paddingY${n}']`]),
|
|
96
|
+
nativeStyle: (n) => ([`paddingY${n}: { paddingTop:${n}, paddingBottom:${n}}`])
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const paddingT = {
|
|
100
|
+
target: `fixed`,
|
|
101
|
+
write: (n='') => ([`paddingT${n}`]),
|
|
102
|
+
webClasses: (n) => ([`paddingT${n}: 'paddingT${n}'`]),
|
|
103
|
+
webStyle: (n) => ([`.paddingT${n} { padding-top:n.$px${n} }`]),
|
|
104
|
+
nativeClasses: (n) => ([`paddingT${n}: style['paddingT${n}']`]),
|
|
105
|
+
nativeStyle: (n) => ([`paddingT${n}: { paddingTop:${n} }`])
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const paddingB = {
|
|
109
|
+
target: `fixed`,
|
|
110
|
+
write: (n='') => ([`paddingB${n}`]),
|
|
111
|
+
webClasses: (n) => ([`paddingB${n}: 'paddingB${n}'`]),
|
|
112
|
+
webStyle: (n) => ([`.paddingB${n} { padding-bottom:n.$px${n} }`]),
|
|
113
|
+
nativeClasses: (n) => ([`paddingB${n}: style['paddingB${n}']`]),
|
|
114
|
+
nativeStyle: (n) => ([`paddingB${n}: { paddingBottom:${n}}`])
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const paddingS = {
|
|
118
|
+
target: `directional`,
|
|
119
|
+
write: (n='') => ([
|
|
120
|
+
`paddingS${n}`,
|
|
121
|
+
`paddingE${n}`
|
|
122
|
+
]),
|
|
123
|
+
webClasses: (n) => ([
|
|
124
|
+
`paddingS${n}: isRTL ? 'paddingR${n}' : 'paddingL${n}'`,
|
|
125
|
+
`paddingE${n}: isRTL ? 'paddingL${n}' : 'paddingR${n}'`
|
|
126
|
+
]),
|
|
127
|
+
webStyle: (n) => ([
|
|
128
|
+
`.paddingL${n} { padding-left:n.$px${n} }`,
|
|
129
|
+
`.paddingR${n} { padding-right:n.$px${n} }`
|
|
130
|
+
]),
|
|
131
|
+
nativeClasses: (n) => ([
|
|
132
|
+
`paddingS${n}: style[isRTL ? 'paddingR${n}' : 'paddingL${n}']`,
|
|
133
|
+
`paddingE${n}: style[isRTL ? 'paddingL${n}' : 'paddingR${n}']`
|
|
134
|
+
]),
|
|
135
|
+
nativeStyle: (n) => ([
|
|
136
|
+
`paddingL${n}: { paddingLeft:${n} }`,
|
|
137
|
+
`paddingR${n}: { paddingRight:${n} }`
|
|
138
|
+
])
|
|
139
|
+
}
|
|
140
|
+
export const paddingE = paddingS
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export const textC = {
|
|
2
|
+
target: `fixed`,
|
|
3
|
+
write: (n='') => ([`textC`]),
|
|
4
|
+
webClasses: (n) => ([`textC: 'textC'`]),
|
|
5
|
+
webStyle: (n) => ([`.textC { text-align:center }`]),
|
|
6
|
+
nativeClasses: (n) => ([`textC: style['textC']`]),
|
|
7
|
+
nativeStyle: (n) => ([`textC: { textAlign:'center' }`])
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const textS = {
|
|
11
|
+
target: `directional`,
|
|
12
|
+
write: () => ([
|
|
13
|
+
`textS`,
|
|
14
|
+
`textE`
|
|
15
|
+
]),
|
|
16
|
+
webClasses: () => ([
|
|
17
|
+
`textS: isRTL ? 'textR' : 'textL'`,
|
|
18
|
+
`textE: isRTL ? 'textL' : 'textR'`
|
|
19
|
+
]),
|
|
20
|
+
webStyle: () => ([
|
|
21
|
+
`.textL { text-align:left }`,
|
|
22
|
+
`.textR { text-align:right }`
|
|
23
|
+
]),
|
|
24
|
+
nativeClasses: () => ([
|
|
25
|
+
`textS: style[ isRTL ? 'textR' : 'textL' ]`,
|
|
26
|
+
`textE: style[ isRTL ? 'textL' : 'textR' ]`,
|
|
27
|
+
]),
|
|
28
|
+
nativeStyle: () => ([
|
|
29
|
+
`textL: { textAlign:'left' }`,
|
|
30
|
+
`textR: { textAlign:'right' }`,
|
|
31
|
+
])
|
|
32
|
+
}
|
|
33
|
+
export const textE = textS
|
|
34
|
+
|
|
35
|
+
export const fw = {
|
|
36
|
+
target: `fixed`,
|
|
37
|
+
write: (n='') => ([`fw${n}`]),
|
|
38
|
+
webClasses: (n) => ([`fw${n}: 'fw${n}'`]),
|
|
39
|
+
webStyle: (n) => ([`.fw${n} { font-weight:${n} }`]),
|
|
40
|
+
nativeClasses: (n) => ([`fw${n}: style['fw${n}']`]),
|
|
41
|
+
nativeStyle: (n) => ([`fw${n}: { fontWeight:${n} }`])
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const lh = {
|
|
45
|
+
target: `fixed`,
|
|
46
|
+
write: (n='') => ([`lh${n}`]),
|
|
47
|
+
webClasses: (n) => ([`lh${n}: 'lh${n}'`]),
|
|
48
|
+
webStyle: (n) => ([`.lh${n} { line-height:n.$px${n} }`]),
|
|
49
|
+
nativeClasses: (n) => ([`lh${n}: style['lh${n}']`]),
|
|
50
|
+
nativeStyle: (n) => ([`lh${n}: { lineHeight:${n} }`])
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const fs = {
|
|
54
|
+
target: `fixed`,
|
|
55
|
+
write: (n='') => ([`fs${n}`]),
|
|
56
|
+
webClasses: (n) => ([`fs${n}: 'fs${n}'`]),
|
|
57
|
+
webStyle: (n) => ([`.fs${n} { font-size:n.$px${n} }`]),
|
|
58
|
+
nativeClasses: (n) => ([`fs${n}: style['fs${n}']`]),
|
|
59
|
+
nativeStyle: (n) => ([`fs${n}: { fontSize:${n} }`])
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const noSelect = {
|
|
63
|
+
target: `fixed`,
|
|
64
|
+
write: (n='') => ([`noSelect`]),
|
|
65
|
+
webClasses: (n) => ([`noSelect: 'noSelect'`]),
|
|
66
|
+
webStyle: (n) => ([`.noSelect { user-select: none }`]),
|
|
67
|
+
nativeClasses: (n) => ([`noSelect: style['noSelect']`]),
|
|
68
|
+
nativeStyle: (n) => ([`noSelect: { userSelect: 'none' }`])
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const ellipsis = {
|
|
72
|
+
target: `fixed`,
|
|
73
|
+
write: (n='') => ([`ellipsis`]),
|
|
74
|
+
webClasses: (n) => ([`ellipsis: 'ellipsis'`]),
|
|
75
|
+
webStyle: (n) => ([`.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }`]),
|
|
76
|
+
nativeClasses: (n) => ([`ellipsis: style['ellipsis']`]),
|
|
77
|
+
nativeStyle: (n) => ([`ellipsis: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }`])
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const fdI = {
|
|
81
|
+
target: `fixed`,
|
|
82
|
+
write: (n='') => ([`fdI`]),
|
|
83
|
+
webClasses: (n) => ([`fdI: 'fdI'`]),
|
|
84
|
+
webStyle: (n) => ([`.fdI { font-style: italic }`]),
|
|
85
|
+
nativeClasses: (n) => ([`fdI: style['fdI']`]),
|
|
86
|
+
nativeStyle: (n) => ([`fdI: { fontStyle: 'italic' }`])
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const fdS = {
|
|
90
|
+
target: `fixed`,
|
|
91
|
+
write: (n='') => ([`fdS`]),
|
|
92
|
+
webClasses: (n) => ([`fdS: 'fdS'`]),
|
|
93
|
+
webStyle: (n) => ([`.fdS { text-decoration: line-through }`]),
|
|
94
|
+
nativeClasses: (n) => ([`fdS: style['fdS']`]),
|
|
95
|
+
nativeStyle: (n) => ([`fdS: { textDecorationLine: 'line-through' }`])
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const fdU = {
|
|
99
|
+
target: `fixed`,
|
|
100
|
+
write: (n='') => ([`fdU`]),
|
|
101
|
+
webClasses: (n) => ([`fdU: 'fdU'`]),
|
|
102
|
+
webStyle: (n) => ([`.fdU { text-decoration: underline }`]),
|
|
103
|
+
nativeClasses: (n) => ([`fdU: style['fdU']`]),
|
|
104
|
+
nativeStyle: (n) => ([`fdU: { textDecorationLine: 'underline' }`])
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const fdUS = {
|
|
108
|
+
target: `fixed`,
|
|
109
|
+
write: (n='') => ([`fdUS`]),
|
|
110
|
+
webClasses: (n) => ([`fdUS: 'fdUS'`]),
|
|
111
|
+
webStyle: (n) => ([`.fdUS { text-decoration: underline line-through }`]),
|
|
112
|
+
nativeClasses: (n) => ([`fdUS: style['fdUS']`]),
|
|
113
|
+
nativeStyle: (n) => ([`fdUS: { textDecorationLine: 'underline line-through' }`])
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const fpSub = {
|
|
117
|
+
target: `fixed`,
|
|
118
|
+
write: (n='') => ([`fpSub${n}`]),
|
|
119
|
+
webClasses: (n) => ([`fpSub${n}: 'fpSub${n}'`]),
|
|
120
|
+
webStyle: (n) => ([`.fpSub${n} { font-size:n.$px${Math.floor(n*0.75)} !important; transform: translateY(- n.$px${Math.floor(n*0.25)}); display: inline-block !important }`]),
|
|
121
|
+
nativeClasses: (n) => ([`fpSub${n}: style['fpSub${n}']`]),
|
|
122
|
+
nativeStyle: (n) => ([`fpSub${n}: { fontSize:${Math.floor(n*0.75)}, transform: [{ translateY: ${Math.floor(n*0.35)} }] }`])
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const fpSup = {
|
|
126
|
+
target: `fixed`,
|
|
127
|
+
write: (n='') => ([`fpSup${n}`]),
|
|
128
|
+
webClasses: (n) => ([`fpSup${n}: 'fpSup${n}'`]),
|
|
129
|
+
webStyle: (n) => ([`.fpSup${n} { font-size:n.$px${Math.floor(n*0.75)} !important; transform: translateY(n.$px${Math.floor(n*0.25)}); display: inline-block !important }`]),
|
|
130
|
+
nativeClasses: (n) => ([`fpSup${n}: style['fpSup${n}']`]),
|
|
131
|
+
nativeStyle: (n) => ([`fpSup${n}: { fontSize:${Math.floor(n*0.75)}, transform: [{ translateY: ${Math.floor(n*0.35)} }] }`])
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// custom
|
|
135
|
+
export const textblock = {
|
|
136
|
+
target: `fixed`,
|
|
137
|
+
write: (n='') => ([`textblock`]),
|
|
138
|
+
webClasses: (n) => ([`textblock: 'textblock'`]),
|
|
139
|
+
webStyle: (n) => ([`.textblock { display: inline; white-space: pre-wrap }`]),
|
|
140
|
+
nativeClasses: (n) => ([`textblock: style['textblock']`]),
|
|
141
|
+
nativeStyle: (n) => ([`textblock: { flexWrap: 'wrap' }`])
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const textwrap = {
|
|
145
|
+
target: `fixed`,
|
|
146
|
+
write: (n='') => ([`textwrap`]),
|
|
147
|
+
webClasses: (n) => ([`textwrap: 'textwrap'`]),
|
|
148
|
+
webStyle: (n) => ([`.textwrap { white-space: pre-wrap }`]),
|
|
149
|
+
nativeClasses: (n) => ([`textwrap: style['textwrap']`]),
|
|
150
|
+
nativeStyle: (n) => ([`textwrap: { flexWrap: 'wrap' }`])
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
export const textline = {
|
|
155
|
+
target: `fixed`,
|
|
156
|
+
write: (n='') => ([`textline`]),
|
|
157
|
+
webClasses: (n) => ([`textline: 'textline'`]),
|
|
158
|
+
webStyle: (n) => ([`.textline { display: inline-block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden }`]),
|
|
159
|
+
nativeClasses: (n) => ([`textline: style['textline']`]),
|
|
160
|
+
nativeStyle: (n) => ([`textline: { overflow: 'hidden' }`])
|
|
161
|
+
//need to add props numberOfLines={1} ellipsizeMode="tail"
|
|
162
|
+
}
|