create-jant 0.1.13 → 0.1.14
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/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/node_modules/@jant/core/CHANGELOG.md +6 -0
- package/template/node_modules/@jant/core/package.json +1 -5
- package/template/node_modules/@jant/core/src/preset.css +3 -1
- package/template/node_modules/@tailwindcss/{postcss → vite}/README.md +11 -61
- package/template/node_modules/@tailwindcss/vite/dist/index.d.mts +13 -0
- package/template/node_modules/@tailwindcss/vite/dist/index.mjs +1 -0
- package/template/node_modules/@tailwindcss/vite/node_modules/.bin/vite +21 -0
- package/template/node_modules/@tailwindcss/vite/package.json +42 -0
- package/template/package.json +1 -3
- package/template/src/style.css +0 -3
- package/template/vite.config.ts +2 -8
- package/template/node_modules/.bin/autoprefixer +0 -21
- package/template/node_modules/@jant/core/src/tailwind.ts +0 -20
- package/template/node_modules/@tailwindcss/postcss/dist/index.d.mts +0 -25
- package/template/node_modules/@tailwindcss/postcss/dist/index.d.ts +0 -25
- package/template/node_modules/@tailwindcss/postcss/dist/index.js +0 -10
- package/template/node_modules/@tailwindcss/postcss/dist/index.mjs +0 -10
- package/template/node_modules/@tailwindcss/postcss/package.json +0 -46
- package/template/node_modules/autoprefixer/LICENSE +0 -20
- package/template/node_modules/autoprefixer/README.md +0 -57
- package/template/node_modules/autoprefixer/bin/autoprefixer +0 -22
- package/template/node_modules/autoprefixer/data/prefixes.js +0 -1139
- package/template/node_modules/autoprefixer/lib/at-rule.js +0 -35
- package/template/node_modules/autoprefixer/lib/autoprefixer.d.ts +0 -95
- package/template/node_modules/autoprefixer/lib/autoprefixer.js +0 -164
- package/template/node_modules/autoprefixer/lib/brackets.js +0 -51
- package/template/node_modules/autoprefixer/lib/browsers.js +0 -79
- package/template/node_modules/autoprefixer/lib/declaration.js +0 -187
- package/template/node_modules/autoprefixer/lib/hacks/align-content.js +0 -49
- package/template/node_modules/autoprefixer/lib/hacks/align-items.js +0 -46
- package/template/node_modules/autoprefixer/lib/hacks/align-self.js +0 -56
- package/template/node_modules/autoprefixer/lib/hacks/animation.js +0 -17
- package/template/node_modules/autoprefixer/lib/hacks/appearance.js +0 -23
- package/template/node_modules/autoprefixer/lib/hacks/autofill.js +0 -26
- package/template/node_modules/autoprefixer/lib/hacks/backdrop-filter.js +0 -20
- package/template/node_modules/autoprefixer/lib/hacks/background-clip.js +0 -24
- package/template/node_modules/autoprefixer/lib/hacks/background-size.js +0 -23
- package/template/node_modules/autoprefixer/lib/hacks/block-logical.js +0 -40
- package/template/node_modules/autoprefixer/lib/hacks/border-image.js +0 -15
- package/template/node_modules/autoprefixer/lib/hacks/border-radius.js +0 -40
- package/template/node_modules/autoprefixer/lib/hacks/break-props.js +0 -63
- package/template/node_modules/autoprefixer/lib/hacks/cross-fade.js +0 -35
- package/template/node_modules/autoprefixer/lib/hacks/display-flex.js +0 -65
- package/template/node_modules/autoprefixer/lib/hacks/display-grid.js +0 -21
- package/template/node_modules/autoprefixer/lib/hacks/file-selector-button.js +0 -26
- package/template/node_modules/autoprefixer/lib/hacks/filter-value.js +0 -14
- package/template/node_modules/autoprefixer/lib/hacks/filter.js +0 -19
- package/template/node_modules/autoprefixer/lib/hacks/flex-basis.js +0 -39
- package/template/node_modules/autoprefixer/lib/hacks/flex-direction.js +0 -72
- package/template/node_modules/autoprefixer/lib/hacks/flex-flow.js +0 -53
- package/template/node_modules/autoprefixer/lib/hacks/flex-grow.js +0 -30
- package/template/node_modules/autoprefixer/lib/hacks/flex-shrink.js +0 -39
- package/template/node_modules/autoprefixer/lib/hacks/flex-spec.js +0 -19
- package/template/node_modules/autoprefixer/lib/hacks/flex-wrap.js +0 -19
- package/template/node_modules/autoprefixer/lib/hacks/flex.js +0 -54
- package/template/node_modules/autoprefixer/lib/hacks/fullscreen.js +0 -20
- package/template/node_modules/autoprefixer/lib/hacks/gradient.js +0 -447
- package/template/node_modules/autoprefixer/lib/hacks/grid-area.js +0 -34
- package/template/node_modules/autoprefixer/lib/hacks/grid-column-align.js +0 -28
- package/template/node_modules/autoprefixer/lib/hacks/grid-end.js +0 -52
- package/template/node_modules/autoprefixer/lib/hacks/grid-row-align.js +0 -28
- package/template/node_modules/autoprefixer/lib/hacks/grid-row-column.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js +0 -125
- package/template/node_modules/autoprefixer/lib/hacks/grid-start.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/grid-template-areas.js +0 -84
- package/template/node_modules/autoprefixer/lib/hacks/grid-template.js +0 -69
- package/template/node_modules/autoprefixer/lib/hacks/grid-utils.js +0 -1117
- package/template/node_modules/autoprefixer/lib/hacks/image-rendering.js +0 -48
- package/template/node_modules/autoprefixer/lib/hacks/image-set.js +0 -18
- package/template/node_modules/autoprefixer/lib/hacks/inline-logical.js +0 -34
- package/template/node_modules/autoprefixer/lib/hacks/intrinsic.js +0 -61
- package/template/node_modules/autoprefixer/lib/hacks/justify-content.js +0 -54
- package/template/node_modules/autoprefixer/lib/hacks/mask-border.js +0 -38
- package/template/node_modules/autoprefixer/lib/hacks/mask-composite.js +0 -88
- package/template/node_modules/autoprefixer/lib/hacks/order.js +0 -42
- package/template/node_modules/autoprefixer/lib/hacks/overscroll-behavior.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/pixelated.js +0 -34
- package/template/node_modules/autoprefixer/lib/hacks/place-self.js +0 -32
- package/template/node_modules/autoprefixer/lib/hacks/placeholder-shown.js +0 -19
- package/template/node_modules/autoprefixer/lib/hacks/placeholder.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/print-color-adjust.js +0 -25
- package/template/node_modules/autoprefixer/lib/hacks/text-decoration-skip-ink.js +0 -23
- package/template/node_modules/autoprefixer/lib/hacks/text-decoration.js +0 -25
- package/template/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js +0 -14
- package/template/node_modules/autoprefixer/lib/hacks/transform-decl.js +0 -79
- package/template/node_modules/autoprefixer/lib/hacks/user-select.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/writing-mode.js +0 -42
- package/template/node_modules/autoprefixer/lib/info.js +0 -123
- package/template/node_modules/autoprefixer/lib/old-selector.js +0 -67
- package/template/node_modules/autoprefixer/lib/old-value.js +0 -22
- package/template/node_modules/autoprefixer/lib/prefixer.js +0 -144
- package/template/node_modules/autoprefixer/lib/prefixes.js +0 -428
- package/template/node_modules/autoprefixer/lib/processor.js +0 -709
- package/template/node_modules/autoprefixer/lib/resolution.js +0 -97
- package/template/node_modules/autoprefixer/lib/selector.js +0 -150
- package/template/node_modules/autoprefixer/lib/supports.js +0 -302
- package/template/node_modules/autoprefixer/lib/transition.js +0 -329
- package/template/node_modules/autoprefixer/lib/utils.js +0 -93
- package/template/node_modules/autoprefixer/lib/value.js +0 -125
- package/template/node_modules/autoprefixer/lib/vendor.js +0 -14
- package/template/node_modules/autoprefixer/node_modules/.bin/autoprefixer +0 -21
- package/template/node_modules/autoprefixer/node_modules/.bin/browserslist +0 -21
- package/template/node_modules/autoprefixer/package.json +0 -48
- package/template/node_modules/postcss/LICENSE +0 -20
- package/template/node_modules/postcss/README.md +0 -29
- package/template/node_modules/postcss/lib/at-rule.d.ts +0 -140
- package/template/node_modules/postcss/lib/at-rule.js +0 -25
- package/template/node_modules/postcss/lib/comment.d.ts +0 -68
- package/template/node_modules/postcss/lib/comment.js +0 -13
- package/template/node_modules/postcss/lib/container.d.ts +0 -483
- package/template/node_modules/postcss/lib/container.js +0 -447
- package/template/node_modules/postcss/lib/css-syntax-error.d.ts +0 -248
- package/template/node_modules/postcss/lib/css-syntax-error.js +0 -133
- package/template/node_modules/postcss/lib/declaration.d.ts +0 -151
- package/template/node_modules/postcss/lib/declaration.js +0 -24
- package/template/node_modules/postcss/lib/document.d.ts +0 -69
- package/template/node_modules/postcss/lib/document.js +0 -33
- package/template/node_modules/postcss/lib/fromJSON.d.ts +0 -9
- package/template/node_modules/postcss/lib/fromJSON.js +0 -54
- package/template/node_modules/postcss/lib/input.d.ts +0 -227
- package/template/node_modules/postcss/lib/input.js +0 -265
- package/template/node_modules/postcss/lib/lazy-result.d.ts +0 -190
- package/template/node_modules/postcss/lib/lazy-result.js +0 -550
- package/template/node_modules/postcss/lib/list.d.ts +0 -60
- package/template/node_modules/postcss/lib/list.js +0 -58
- package/template/node_modules/postcss/lib/map-generator.js +0 -368
- package/template/node_modules/postcss/lib/no-work-result.d.ts +0 -46
- package/template/node_modules/postcss/lib/no-work-result.js +0 -138
- package/template/node_modules/postcss/lib/node.d.ts +0 -556
- package/template/node_modules/postcss/lib/node.js +0 -449
- package/template/node_modules/postcss/lib/parse.d.ts +0 -9
- package/template/node_modules/postcss/lib/parse.js +0 -42
- package/template/node_modules/postcss/lib/parser.js +0 -611
- package/template/node_modules/postcss/lib/postcss.d.mts +0 -69
- package/template/node_modules/postcss/lib/postcss.d.ts +0 -458
- package/template/node_modules/postcss/lib/postcss.js +0 -101
- package/template/node_modules/postcss/lib/postcss.mjs +0 -30
- package/template/node_modules/postcss/lib/previous-map.d.ts +0 -81
- package/template/node_modules/postcss/lib/previous-map.js +0 -144
- package/template/node_modules/postcss/lib/processor.d.ts +0 -115
- package/template/node_modules/postcss/lib/processor.js +0 -67
- package/template/node_modules/postcss/lib/result.d.ts +0 -205
- package/template/node_modules/postcss/lib/result.js +0 -42
- package/template/node_modules/postcss/lib/root.d.ts +0 -87
- package/template/node_modules/postcss/lib/root.js +0 -61
- package/template/node_modules/postcss/lib/rule.d.ts +0 -126
- package/template/node_modules/postcss/lib/rule.js +0 -27
- package/template/node_modules/postcss/lib/stringifier.d.ts +0 -46
- package/template/node_modules/postcss/lib/stringifier.js +0 -353
- package/template/node_modules/postcss/lib/stringify.d.ts +0 -9
- package/template/node_modules/postcss/lib/stringify.js +0 -11
- package/template/node_modules/postcss/lib/symbols.js +0 -5
- package/template/node_modules/postcss/lib/terminal-highlight.js +0 -70
- package/template/node_modules/postcss/lib/tokenize.js +0 -266
- package/template/node_modules/postcss/lib/warn-once.js +0 -13
- package/template/node_modules/postcss/lib/warning.d.ts +0 -147
- package/template/node_modules/postcss/lib/warning.js +0 -37
- package/template/node_modules/postcss/node_modules/.bin/nanoid +0 -21
- package/template/node_modules/postcss/package.json +0 -88
- package/template/tailwind.config.ts +0 -13
- /package/template/node_modules/@tailwindcss/{postcss → vite}/LICENSE +0 -0
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
let { list } = require('postcss')
|
|
2
|
-
let parser = require('postcss-value-parser')
|
|
3
|
-
|
|
4
|
-
let Browsers = require('./browsers')
|
|
5
|
-
let vendor = require('./vendor')
|
|
6
|
-
|
|
7
|
-
class Transition {
|
|
8
|
-
constructor(prefixes) {
|
|
9
|
-
this.props = ['transition', 'transition-property']
|
|
10
|
-
this.prefixes = prefixes
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Process transition and add prefixes for all necessary properties
|
|
15
|
-
*/
|
|
16
|
-
add(decl, result) {
|
|
17
|
-
let prefix, prop
|
|
18
|
-
let add = this.prefixes.add[decl.prop]
|
|
19
|
-
let vendorPrefixes = this.ruleVendorPrefixes(decl)
|
|
20
|
-
let declPrefixes = vendorPrefixes || (add && add.prefixes) || []
|
|
21
|
-
|
|
22
|
-
let params = this.parse(decl.value)
|
|
23
|
-
let names = params.map(i => this.findProp(i))
|
|
24
|
-
let added = []
|
|
25
|
-
|
|
26
|
-
if (names.some(i => i[0] === '-')) {
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
for (let param of params) {
|
|
31
|
-
prop = this.findProp(param)
|
|
32
|
-
if (prop[0] === '-') continue
|
|
33
|
-
|
|
34
|
-
let prefixer = this.prefixes.add[prop]
|
|
35
|
-
if (!prefixer || !prefixer.prefixes) continue
|
|
36
|
-
|
|
37
|
-
for (prefix of prefixer.prefixes) {
|
|
38
|
-
if (vendorPrefixes && !vendorPrefixes.some(p => prefix.includes(p))) {
|
|
39
|
-
continue
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let prefixed = this.prefixes.prefixed(prop, prefix)
|
|
43
|
-
if (prefixed !== '-ms-transform' && !names.includes(prefixed)) {
|
|
44
|
-
if (!this.disabled(prop, prefix)) {
|
|
45
|
-
added.push(this.clone(prop, prefixed, param))
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
params = params.concat(added)
|
|
52
|
-
let value = this.stringify(params)
|
|
53
|
-
|
|
54
|
-
let webkitClean = this.stringify(
|
|
55
|
-
this.cleanFromUnprefixed(params, '-webkit-')
|
|
56
|
-
)
|
|
57
|
-
if (declPrefixes.includes('-webkit-')) {
|
|
58
|
-
this.cloneBefore(decl, `-webkit-${decl.prop}`, webkitClean)
|
|
59
|
-
}
|
|
60
|
-
this.cloneBefore(decl, decl.prop, webkitClean)
|
|
61
|
-
if (declPrefixes.includes('-o-')) {
|
|
62
|
-
let operaClean = this.stringify(this.cleanFromUnprefixed(params, '-o-'))
|
|
63
|
-
this.cloneBefore(decl, `-o-${decl.prop}`, operaClean)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
for (prefix of declPrefixes) {
|
|
67
|
-
if (prefix !== '-webkit-' && prefix !== '-o-') {
|
|
68
|
-
let prefixValue = this.stringify(
|
|
69
|
-
this.cleanOtherPrefixes(params, prefix)
|
|
70
|
-
)
|
|
71
|
-
this.cloneBefore(decl, prefix + decl.prop, prefixValue)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (value !== decl.value && !this.already(decl, decl.prop, value)) {
|
|
76
|
-
this.checkForWarning(result, decl)
|
|
77
|
-
decl.cloneBefore()
|
|
78
|
-
decl.value = value
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Does we already have this declaration
|
|
84
|
-
*/
|
|
85
|
-
already(decl, prop, value) {
|
|
86
|
-
return decl.parent.some(i => i.prop === prop && i.value === value)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Show transition-property warning
|
|
91
|
-
*/
|
|
92
|
-
checkForWarning(result, decl) {
|
|
93
|
-
if (decl.prop !== 'transition-property') {
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
let isPrefixed = false
|
|
98
|
-
let hasAssociatedProp = false
|
|
99
|
-
|
|
100
|
-
decl.parent.each(i => {
|
|
101
|
-
if (i.type !== 'decl') {
|
|
102
|
-
return undefined
|
|
103
|
-
}
|
|
104
|
-
if (i.prop.indexOf('transition-') !== 0) {
|
|
105
|
-
return undefined
|
|
106
|
-
}
|
|
107
|
-
let values = list.comma(i.value)
|
|
108
|
-
// check if current Rule's transition-property comma separated value list needs prefixes
|
|
109
|
-
if (i.prop === 'transition-property') {
|
|
110
|
-
values.forEach(value => {
|
|
111
|
-
let lookup = this.prefixes.add[value]
|
|
112
|
-
if (lookup && lookup.prefixes && lookup.prefixes.length > 0) {
|
|
113
|
-
isPrefixed = true
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
return undefined
|
|
117
|
-
}
|
|
118
|
-
// check if another transition-* prop in current Rule has comma separated value list
|
|
119
|
-
hasAssociatedProp = hasAssociatedProp || values.length > 1
|
|
120
|
-
return false
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
if (isPrefixed && hasAssociatedProp) {
|
|
124
|
-
decl.warn(
|
|
125
|
-
result,
|
|
126
|
-
'Replace transition-property to transition, ' +
|
|
127
|
-
'because Autoprefixer could not support ' +
|
|
128
|
-
'any cases of transition-property ' +
|
|
129
|
-
'and other transition-*'
|
|
130
|
-
)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Remove all non-webkit prefixes and unprefixed params if we have prefixed
|
|
136
|
-
*/
|
|
137
|
-
cleanFromUnprefixed(params, prefix) {
|
|
138
|
-
let remove = params
|
|
139
|
-
.map(i => this.findProp(i))
|
|
140
|
-
.filter(i => i.slice(0, prefix.length) === prefix)
|
|
141
|
-
.map(i => this.prefixes.unprefixed(i))
|
|
142
|
-
|
|
143
|
-
let result = []
|
|
144
|
-
for (let param of params) {
|
|
145
|
-
let prop = this.findProp(param)
|
|
146
|
-
let p = vendor.prefix(prop)
|
|
147
|
-
if (!remove.includes(prop) && (p === prefix || p === '')) {
|
|
148
|
-
result.push(param)
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return result
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
cleanOtherPrefixes(params, prefix) {
|
|
155
|
-
return params.filter(param => {
|
|
156
|
-
let current = vendor.prefix(this.findProp(param))
|
|
157
|
-
return current === '' || current === prefix
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Return new param array with different name
|
|
163
|
-
*/
|
|
164
|
-
clone(origin, name, param) {
|
|
165
|
-
let result = []
|
|
166
|
-
let changed = false
|
|
167
|
-
for (let i of param) {
|
|
168
|
-
if (!changed && i.type === 'word' && i.value === origin) {
|
|
169
|
-
result.push({ type: 'word', value: name })
|
|
170
|
-
changed = true
|
|
171
|
-
} else {
|
|
172
|
-
result.push(i)
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
return result
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Add declaration if it is not exist
|
|
180
|
-
*/
|
|
181
|
-
cloneBefore(decl, prop, value) {
|
|
182
|
-
if (!this.already(decl, prop, value)) {
|
|
183
|
-
decl.cloneBefore({ prop, value })
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Check property for disabled by option
|
|
189
|
-
*/
|
|
190
|
-
disabled(prop, prefix) {
|
|
191
|
-
let other = ['order', 'justify-content', 'align-self', 'align-content']
|
|
192
|
-
if (prop.includes('flex') || other.includes(prop)) {
|
|
193
|
-
if (this.prefixes.options.flexbox === false) {
|
|
194
|
-
return true
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (this.prefixes.options.flexbox === 'no-2009') {
|
|
198
|
-
return prefix.includes('2009')
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return undefined
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Find or create separator
|
|
206
|
-
*/
|
|
207
|
-
div(params) {
|
|
208
|
-
for (let param of params) {
|
|
209
|
-
for (let node of param) {
|
|
210
|
-
if (node.type === 'div' && node.value === ',') {
|
|
211
|
-
return node
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
return { after: ' ', type: 'div', value: ',' }
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Find property name
|
|
220
|
-
*/
|
|
221
|
-
findProp(param) {
|
|
222
|
-
let prop = param[0].value
|
|
223
|
-
if (/^\d/.test(prop)) {
|
|
224
|
-
for (let [i, token] of param.entries()) {
|
|
225
|
-
if (i !== 0 && token.type === 'word') {
|
|
226
|
-
return token.value
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return prop
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Parse properties list to array
|
|
235
|
-
*/
|
|
236
|
-
parse(value) {
|
|
237
|
-
let ast = parser(value)
|
|
238
|
-
let result = []
|
|
239
|
-
let param = []
|
|
240
|
-
for (let node of ast.nodes) {
|
|
241
|
-
param.push(node)
|
|
242
|
-
if (node.type === 'div' && node.value === ',') {
|
|
243
|
-
result.push(param)
|
|
244
|
-
param = []
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
result.push(param)
|
|
248
|
-
return result.filter(i => i.length > 0)
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Process transition and remove all unnecessary properties
|
|
253
|
-
*/
|
|
254
|
-
remove(decl) {
|
|
255
|
-
let params = this.parse(decl.value)
|
|
256
|
-
params = params.filter(i => {
|
|
257
|
-
let prop = this.prefixes.remove[this.findProp(i)]
|
|
258
|
-
return !prop || !prop.remove
|
|
259
|
-
})
|
|
260
|
-
let value = this.stringify(params)
|
|
261
|
-
|
|
262
|
-
if (decl.value === value) {
|
|
263
|
-
return
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (params.length === 0) {
|
|
267
|
-
decl.remove()
|
|
268
|
-
return
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
let double = decl.parent.some(i => {
|
|
272
|
-
return i.prop === decl.prop && i.value === value
|
|
273
|
-
})
|
|
274
|
-
let smaller = decl.parent.some(i => {
|
|
275
|
-
return i !== decl && i.prop === decl.prop && i.value.length > value.length
|
|
276
|
-
})
|
|
277
|
-
|
|
278
|
-
if (double || smaller) {
|
|
279
|
-
decl.remove()
|
|
280
|
-
return
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
decl.value = value
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Check if transition prop is inside vendor specific rule
|
|
288
|
-
*/
|
|
289
|
-
ruleVendorPrefixes(decl) {
|
|
290
|
-
let { parent } = decl
|
|
291
|
-
|
|
292
|
-
if (parent.type !== 'rule') {
|
|
293
|
-
return false
|
|
294
|
-
} else if (!parent.selector.includes(':-')) {
|
|
295
|
-
return false
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
let selectors = Browsers.prefixes().filter(s =>
|
|
299
|
-
parent.selector.includes(':' + s)
|
|
300
|
-
)
|
|
301
|
-
|
|
302
|
-
return selectors.length > 0 ? selectors : false
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Return properties string from array
|
|
307
|
-
*/
|
|
308
|
-
stringify(params) {
|
|
309
|
-
if (params.length === 0) {
|
|
310
|
-
return ''
|
|
311
|
-
}
|
|
312
|
-
let nodes = []
|
|
313
|
-
for (let param of params) {
|
|
314
|
-
if (param[param.length - 1].type !== 'div') {
|
|
315
|
-
param.push(this.div(params))
|
|
316
|
-
}
|
|
317
|
-
nodes.push(...param)
|
|
318
|
-
}
|
|
319
|
-
if (nodes[0].type === 'div') {
|
|
320
|
-
nodes = nodes.slice(1)
|
|
321
|
-
}
|
|
322
|
-
if (nodes[nodes.length - 1].type === 'div') {
|
|
323
|
-
nodes = nodes.slice(0, +-2 + 1 || undefined)
|
|
324
|
-
}
|
|
325
|
-
return parser.stringify({ nodes })
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
module.exports = Transition
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
let { list } = require('postcss')
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Throw special error, to tell beniary,
|
|
5
|
-
* that this error is from Autoprefixer.
|
|
6
|
-
*/
|
|
7
|
-
module.exports.error = function (text) {
|
|
8
|
-
let err = new Error(text)
|
|
9
|
-
err.autoprefixer = true
|
|
10
|
-
throw err
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Return array, that doesn’t contain duplicates.
|
|
15
|
-
*/
|
|
16
|
-
module.exports.uniq = function (array) {
|
|
17
|
-
return [...new Set(array)]
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Return "-webkit-" on "-webkit- old"
|
|
22
|
-
*/
|
|
23
|
-
module.exports.removeNote = function (string) {
|
|
24
|
-
if (!string.includes(' ')) {
|
|
25
|
-
return string
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return string.split(' ')[0]
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Escape RegExp symbols
|
|
33
|
-
*/
|
|
34
|
-
module.exports.escapeRegexp = function (string) {
|
|
35
|
-
return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&')
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Return regexp to check, that CSS string contain word
|
|
40
|
-
*/
|
|
41
|
-
module.exports.regexp = function (word, escape = true) {
|
|
42
|
-
if (escape) {
|
|
43
|
-
word = this.escapeRegexp(word)
|
|
44
|
-
}
|
|
45
|
-
return new RegExp(`(^|[\\s,(])(${word}($|[\\s(,]))`, 'gi')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Change comma list
|
|
50
|
-
*/
|
|
51
|
-
module.exports.editList = function (value, callback) {
|
|
52
|
-
let origin = list.comma(value)
|
|
53
|
-
let changed = callback(origin, [])
|
|
54
|
-
|
|
55
|
-
if (origin === changed) {
|
|
56
|
-
return value
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
let join = value.match(/,\s*/)
|
|
60
|
-
join = join ? join[0] : ', '
|
|
61
|
-
return changed.join(join)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Split the selector into parts.
|
|
66
|
-
* It returns 3 level deep array because selectors can be comma
|
|
67
|
-
* separated (1), space separated (2), and combined (3)
|
|
68
|
-
* @param {String} selector selector string
|
|
69
|
-
* @return {Array<Array<Array>>} 3 level deep array of split selector
|
|
70
|
-
* @see utils.test.js for examples
|
|
71
|
-
*/
|
|
72
|
-
module.exports.splitSelector = function (selector) {
|
|
73
|
-
return list.comma(selector).map(i => {
|
|
74
|
-
return list.space(i).map(k => {
|
|
75
|
-
return k.split(/(?=\.|#)/g)
|
|
76
|
-
})
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Return true if a given value only contains numbers.
|
|
82
|
-
* @param {*} value
|
|
83
|
-
* @returns {boolean}
|
|
84
|
-
*/
|
|
85
|
-
module.exports.isPureNumber = function (value) {
|
|
86
|
-
if (typeof value === 'number') {
|
|
87
|
-
return true
|
|
88
|
-
}
|
|
89
|
-
if (typeof value === 'string') {
|
|
90
|
-
return /^[0-9]+$/.test(value)
|
|
91
|
-
}
|
|
92
|
-
return false
|
|
93
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
let OldValue = require('./old-value')
|
|
2
|
-
let Prefixer = require('./prefixer')
|
|
3
|
-
let utils = require('./utils')
|
|
4
|
-
let vendor = require('./vendor')
|
|
5
|
-
|
|
6
|
-
class Value extends Prefixer {
|
|
7
|
-
/**
|
|
8
|
-
* Clone decl for each prefixed values
|
|
9
|
-
*/
|
|
10
|
-
static save(prefixes, decl) {
|
|
11
|
-
let prop = decl.prop
|
|
12
|
-
let result = []
|
|
13
|
-
|
|
14
|
-
for (let prefix in decl._autoprefixerValues) {
|
|
15
|
-
let value = decl._autoprefixerValues[prefix]
|
|
16
|
-
|
|
17
|
-
if (value === decl.value) {
|
|
18
|
-
continue
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let item
|
|
22
|
-
let propPrefix = vendor.prefix(prop)
|
|
23
|
-
|
|
24
|
-
if (propPrefix === '-pie-') {
|
|
25
|
-
continue
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (propPrefix === prefix) {
|
|
29
|
-
item = decl.value = value
|
|
30
|
-
result.push(item)
|
|
31
|
-
continue
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
let prefixed = prefixes.prefixed(prop, prefix)
|
|
35
|
-
let rule = decl.parent
|
|
36
|
-
|
|
37
|
-
if (!rule.every(i => i.prop !== prefixed)) {
|
|
38
|
-
result.push(item)
|
|
39
|
-
continue
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let trimmed = value.replace(/\s+/, ' ')
|
|
43
|
-
let already = rule.some(
|
|
44
|
-
i => i.prop === decl.prop && i.value.replace(/\s+/, ' ') === trimmed
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
if (already) {
|
|
48
|
-
result.push(item)
|
|
49
|
-
continue
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
let cloned = this.clone(decl, { value })
|
|
53
|
-
item = decl.parent.insertBefore(decl, cloned)
|
|
54
|
-
|
|
55
|
-
result.push(item)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return result
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Save values with next prefixed token
|
|
63
|
-
*/
|
|
64
|
-
add(decl, prefix) {
|
|
65
|
-
if (!decl._autoprefixerValues) {
|
|
66
|
-
decl._autoprefixerValues = {}
|
|
67
|
-
}
|
|
68
|
-
let value = decl._autoprefixerValues[prefix] || this.value(decl)
|
|
69
|
-
|
|
70
|
-
let before
|
|
71
|
-
do {
|
|
72
|
-
before = value
|
|
73
|
-
value = this.replace(value, prefix)
|
|
74
|
-
if (value === false) return
|
|
75
|
-
} while (value !== before)
|
|
76
|
-
|
|
77
|
-
decl._autoprefixerValues[prefix] = value
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Is declaration need to be prefixed
|
|
82
|
-
*/
|
|
83
|
-
check(decl) {
|
|
84
|
-
let value = decl.value
|
|
85
|
-
if (!value.includes(this.name)) {
|
|
86
|
-
return false
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return !!value.match(this.regexp())
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Return function to fast find prefixed value
|
|
94
|
-
*/
|
|
95
|
-
old(prefix) {
|
|
96
|
-
return new OldValue(this.name, prefix + this.name)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Lazy regexp loading
|
|
101
|
-
*/
|
|
102
|
-
regexp() {
|
|
103
|
-
return this.regexpCache || (this.regexpCache = utils.regexp(this.name))
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Add prefix to values in string
|
|
108
|
-
*/
|
|
109
|
-
replace(string, prefix) {
|
|
110
|
-
return string.replace(this.regexp(), `$1${prefix}$2`)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Get value with comments if it was not changed
|
|
115
|
-
*/
|
|
116
|
-
value(decl) {
|
|
117
|
-
if (decl.raws.value && decl.raws.value.value === decl.value) {
|
|
118
|
-
return decl.raws.value.raw
|
|
119
|
-
} else {
|
|
120
|
-
return decl.value
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
module.exports = Value
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/green/project/jant/node_modules/.pnpm/autoprefixer@10.4.24_postcss@8.5.6/node_modules/autoprefixer/bin/node_modules:/Users/green/project/jant/node_modules/.pnpm/autoprefixer@10.4.24_postcss@8.5.6/node_modules/autoprefixer/node_modules:/Users/green/project/jant/node_modules/.pnpm/autoprefixer@10.4.24_postcss@8.5.6/node_modules:/Users/green/project/jant/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/green/project/jant/node_modules/.pnpm/autoprefixer@10.4.24_postcss@8.5.6/node_modules/autoprefixer/bin/node_modules:/Users/green/project/jant/node_modules/.pnpm/autoprefixer@10.4.24_postcss@8.5.6/node_modules/autoprefixer/node_modules:/Users/green/project/jant/node_modules/.pnpm/autoprefixer@10.4.24_postcss@8.5.6/node_modules:/Users/green/project/jant/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../../bin/autoprefixer" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../../bin/autoprefixer" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/green/project/jant/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/Users/green/project/jant/node_modules/.pnpm/browserslist@4.28.1/node_modules:/Users/green/project/jant/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/Users/green/project/jant/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/Users/green/project/jant/node_modules/.pnpm/browserslist@4.28.1/node_modules:/Users/green/project/jant/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../../../../../browserslist@4.28.1/node_modules/browserslist/cli.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../../../../../browserslist@4.28.1/node_modules/browserslist/cli.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "autoprefixer",
|
|
3
|
-
"version": "10.4.24",
|
|
4
|
-
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
|
|
5
|
-
"engines": {
|
|
6
|
-
"node": "^10 || ^12 || >=14"
|
|
7
|
-
},
|
|
8
|
-
"keywords": [
|
|
9
|
-
"autoprefixer",
|
|
10
|
-
"css",
|
|
11
|
-
"prefix",
|
|
12
|
-
"postcss",
|
|
13
|
-
"postcss-plugin"
|
|
14
|
-
],
|
|
15
|
-
"main": "lib/autoprefixer.js",
|
|
16
|
-
"bin": "bin/autoprefixer",
|
|
17
|
-
"types": "lib/autoprefixer.d.ts",
|
|
18
|
-
"funding": [
|
|
19
|
-
{
|
|
20
|
-
"type": "opencollective",
|
|
21
|
-
"url": "https://opencollective.com/postcss/"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"type": "tidelift",
|
|
25
|
-
"url": "https://tidelift.com/funding/github/npm/autoprefixer"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"type": "github",
|
|
29
|
-
"url": "https://github.com/sponsors/ai"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"author": "Andrey Sitnik <andrey@sitnik.ru>",
|
|
33
|
-
"license": "MIT",
|
|
34
|
-
"repository": "postcss/autoprefixer",
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/postcss/autoprefixer/issues"
|
|
37
|
-
},
|
|
38
|
-
"peerDependencies": {
|
|
39
|
-
"postcss": "^8.1.0"
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"browserslist": "^4.28.1",
|
|
43
|
-
"caniuse-lite": "^1.0.30001766",
|
|
44
|
-
"fraction.js": "^5.3.4",
|
|
45
|
-
"picocolors": "^1.1.1",
|
|
46
|
-
"postcss-value-parser": "^4.2.0"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright 2013 Andrey Sitnik <andrey@sitnik.ru>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# PostCSS
|
|
2
|
-
|
|
3
|
-
<img align="right" width="95" height="95"
|
|
4
|
-
alt="Philosopher’s stone, logo of PostCSS"
|
|
5
|
-
src="https://postcss.org/logo.svg">
|
|
6
|
-
|
|
7
|
-
PostCSS is a tool for transforming styles with JS plugins.
|
|
8
|
-
These plugins can lint your CSS, support variables and mixins,
|
|
9
|
-
transpile future CSS syntax, inline images, and more.
|
|
10
|
-
|
|
11
|
-
PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba,
|
|
12
|
-
and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins are some of the most popular CSS tools.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" /> Built by
|
|
17
|
-
<b><a href="https://evilmartians.com/devtools?utm_source=postcss&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, go-to agency for <b>developer tools</b>.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
[Abstract Syntax Tree]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
|
|
22
|
-
[Evil Martians]: https://evilmartians.com/?utm_source=postcss
|
|
23
|
-
[Autoprefixer]: https://github.com/postcss/autoprefixer
|
|
24
|
-
[Stylelint]: https://stylelint.io/
|
|
25
|
-
[plugins]: https://github.com/postcss/postcss#plugins
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## Docs
|
|
29
|
-
Read full docs **[here](https://postcss.org/)**.
|