Начат фронтенд
This commit is contained in:
34
node_modules/autoprefixer/lib/hacks/intrinsic.js
generated
vendored
34
node_modules/autoprefixer/lib/hacks/intrinsic.js
generated
vendored
@@ -6,11 +6,9 @@ function regexp(name) {
|
||||
}
|
||||
|
||||
class Intrinsic extends Value {
|
||||
add(decl, prefix) {
|
||||
if (decl.prop.includes('grid') && prefix !== '-webkit-') {
|
||||
return undefined
|
||||
}
|
||||
return super.add(decl, prefix)
|
||||
regexp() {
|
||||
if (!this.regexpCache) this.regexpCache = regexp(this.name)
|
||||
return this.regexpCache
|
||||
}
|
||||
|
||||
isStretch() {
|
||||
@@ -21,6 +19,16 @@ class Intrinsic extends Value {
|
||||
)
|
||||
}
|
||||
|
||||
replace(string, prefix) {
|
||||
if (prefix === '-moz-' && this.isStretch()) {
|
||||
return string.replace(this.regexp(), '$1-moz-available$3')
|
||||
}
|
||||
if (prefix === '-webkit-' && this.isStretch()) {
|
||||
return string.replace(this.regexp(), '$1-webkit-fill-available$3')
|
||||
}
|
||||
return super.replace(string, prefix)
|
||||
}
|
||||
|
||||
old(prefix) {
|
||||
let prefixed = prefix + this.name
|
||||
if (this.isStretch()) {
|
||||
@@ -33,19 +41,11 @@ class Intrinsic extends Value {
|
||||
return new OldValue(this.name, prefixed, prefixed, regexp(prefixed))
|
||||
}
|
||||
|
||||
regexp() {
|
||||
if (!this.regexpCache) this.regexpCache = regexp(this.name)
|
||||
return this.regexpCache
|
||||
}
|
||||
|
||||
replace(string, prefix) {
|
||||
if (prefix === '-moz-' && this.isStretch()) {
|
||||
return string.replace(this.regexp(), '$1-moz-available$3')
|
||||
add(decl, prefix) {
|
||||
if (decl.prop.includes('grid') && prefix !== '-webkit-') {
|
||||
return undefined
|
||||
}
|
||||
if (prefix === '-webkit-' && this.isStretch()) {
|
||||
return string.replace(this.regexp(), '$1-webkit-fill-available$3')
|
||||
}
|
||||
return super.replace(string, prefix)
|
||||
return super.add(decl, prefix)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user