UEA-PRODEM
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { Plugin } from 'postcss'
|
||||
import { Stats } from 'browserslist'
|
||||
import { Plugin } from 'postcss'
|
||||
|
||||
declare function autoprefixer<T extends string[]>(
|
||||
...args: [...T, autoprefixer.Options]
|
||||
|
||||
+6
-3
@@ -4,7 +4,7 @@ let OldValue = require('../old-value')
|
||||
let utils = require('../utils')
|
||||
let Value = require('../value')
|
||||
|
||||
let IS_DIRECTION = /top|left|right|bottom/gi
|
||||
const IS_DIRECTION = /top|left|right|bottom/gi
|
||||
|
||||
class Gradient extends Value {
|
||||
/**
|
||||
@@ -229,7 +229,7 @@ class Gradient extends Value {
|
||||
nodes[0].value = this.normalizeUnit(nodes[0].value, 1)
|
||||
} else if (nodes[0].value.includes('deg')) {
|
||||
let num = parseFloat(nodes[0].value)
|
||||
num = (num % 360 + 360) % 360
|
||||
num = ((num % 360) + 360) % 360
|
||||
nodes[0].value = `${num}deg`
|
||||
}
|
||||
|
||||
@@ -338,6 +338,9 @@ class Gradient extends Value {
|
||||
) {
|
||||
return false
|
||||
}
|
||||
if (string.includes('var(')) {
|
||||
return false
|
||||
}
|
||||
|
||||
let params = [[]]
|
||||
for (let i of nodes) {
|
||||
@@ -352,7 +355,7 @@ class Gradient extends Value {
|
||||
|
||||
node.nodes = []
|
||||
for (let param of params) {
|
||||
node.nodes = node.nodes.concat(param)
|
||||
node.nodes.push(...param)
|
||||
}
|
||||
|
||||
node.nodes.unshift(
|
||||
|
||||
+9
-5
@@ -135,13 +135,14 @@ exports.prefixTrackValue = prefixTrackValue
|
||||
function prefixTrackValue({ gap, value }) {
|
||||
let result = parser(value).nodes.reduce((nodes, node) => {
|
||||
if (node.type === 'function' && node.value === 'repeat') {
|
||||
return nodes.concat({
|
||||
nodes.push({
|
||||
type: 'word',
|
||||
value: transformRepeat(node, { gap })
|
||||
})
|
||||
return nodes
|
||||
}
|
||||
if (gap && node.type === 'space') {
|
||||
return nodes.concat(
|
||||
nodes.push(
|
||||
{
|
||||
type: 'space',
|
||||
value: ' '
|
||||
@@ -152,8 +153,10 @@ function prefixTrackValue({ gap, value }) {
|
||||
},
|
||||
node
|
||||
)
|
||||
return nodes
|
||||
}
|
||||
return nodes.concat(node)
|
||||
nodes.push(node)
|
||||
return nodes
|
||||
}, [])
|
||||
|
||||
return parser.stringify(result)
|
||||
@@ -161,7 +164,7 @@ function prefixTrackValue({ gap, value }) {
|
||||
|
||||
// Parse grid-template-areas
|
||||
|
||||
let DOTS = /^\.+$/
|
||||
const DOTS = /^\.+$/
|
||||
|
||||
function track(start, end) {
|
||||
return { end, span: end - start, start }
|
||||
@@ -1046,7 +1049,8 @@ function normalizeRowColumn(str) {
|
||||
if (node.type === 'space') {
|
||||
return result
|
||||
}
|
||||
return result.concat(parser.stringify(node))
|
||||
result.push(parser.stringify(node))
|
||||
return result
|
||||
}, [])
|
||||
|
||||
return normalized
|
||||
|
||||
+2
-2
@@ -192,7 +192,7 @@ class Prefixes {
|
||||
return true
|
||||
}
|
||||
|
||||
if (step === +1 && other.prop === unprefixed) {
|
||||
if (step === 1 && other.prop === unprefixed) {
|
||||
if (!Browsers.withPrefix(other.value)) {
|
||||
break
|
||||
}
|
||||
@@ -206,7 +206,7 @@ class Prefixes {
|
||||
|
||||
return {
|
||||
down(callback) {
|
||||
return checker(+1, callback)
|
||||
return checker(1, callback)
|
||||
},
|
||||
up(callback) {
|
||||
return checker(-1, callback)
|
||||
|
||||
+12
-11
@@ -35,6 +35,17 @@ function hasRowsAndColumns(decl) {
|
||||
return hasRows && hasColumns
|
||||
}
|
||||
|
||||
function insideGrid(decl) {
|
||||
return decl.parent.nodes.some(node => {
|
||||
if (node.type !== 'decl') return false
|
||||
let displayGrid =
|
||||
node.prop === 'display' && /(inline-)?grid/.test(node.value)
|
||||
let gridTemplate = node.prop.startsWith('grid-template')
|
||||
let gridGap = /^grid-([A-z]+-)?gap/.test(node.prop)
|
||||
return displayGrid || gridTemplate || gridGap
|
||||
})
|
||||
}
|
||||
|
||||
class Processor {
|
||||
constructor(prefixes) {
|
||||
this.prefixes = prefixes
|
||||
@@ -84,17 +95,6 @@ class Processor {
|
||||
})
|
||||
})
|
||||
|
||||
function insideGrid(decl) {
|
||||
return decl.parent.nodes.some(node => {
|
||||
if (node.type !== 'decl') return false
|
||||
let displayGrid =
|
||||
node.prop === 'display' && /(inline-)?grid/.test(node.value)
|
||||
let gridTemplate = node.prop.startsWith('grid-template')
|
||||
let gridGap = /^grid-([A-z]+-)?gap/.test(node.prop)
|
||||
return displayGrid || gridTemplate || gridGap
|
||||
})
|
||||
}
|
||||
|
||||
let gridPrefixes =
|
||||
this.gridStatus(css, result) &&
|
||||
this.prefixes.add['grid-area'] &&
|
||||
@@ -586,6 +586,7 @@ class Processor {
|
||||
|
||||
let parts = decl.raw('before').split('\n')
|
||||
let prevMin = parts[parts.length - 1].length
|
||||
/** @type {number|false} */
|
||||
let diff = false
|
||||
|
||||
this.prefixes.group(decl).down(other => {
|
||||
|
||||
+2
-2
@@ -314,13 +314,13 @@ class Transition {
|
||||
if (param[param.length - 1].type !== 'div') {
|
||||
param.push(this.div(params))
|
||||
}
|
||||
nodes = nodes.concat(param)
|
||||
nodes.push(...param)
|
||||
}
|
||||
if (nodes[0].type === 'div') {
|
||||
nodes = nodes.slice(1)
|
||||
}
|
||||
if (nodes[nodes.length - 1].type === 'div') {
|
||||
nodes = nodes.slice(0, +-2 + 1 || undefined)
|
||||
nodes = nodes.slice(0, -1)
|
||||
}
|
||||
return parser.stringify({ nodes })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user