mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-28 15:05:25 +00:00
larry babby and threejs for glsl
This commit is contained in:
54
webGl/my-threejs-test/node_modules/csso/cjs/replace/property/background.cjs
generated
vendored
Normal file
54
webGl/my-threejs-test/node_modules/csso/cjs/replace/property/background.cjs
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
'use strict';
|
||||
|
||||
const cssTree = require('css-tree');
|
||||
|
||||
function compressBackground(node) {
|
||||
function flush() {
|
||||
if (!buffer.length) {
|
||||
buffer.unshift(
|
||||
{
|
||||
type: 'Number',
|
||||
loc: null,
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
type: 'Number',
|
||||
loc: null,
|
||||
value: '0'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
newValue.push.apply(newValue, buffer);
|
||||
|
||||
buffer = [];
|
||||
}
|
||||
|
||||
let newValue = [];
|
||||
let buffer = [];
|
||||
|
||||
node.children.forEach((node) => {
|
||||
if (node.type === 'Operator' && node.value === ',') {
|
||||
flush();
|
||||
newValue.push(node);
|
||||
return;
|
||||
}
|
||||
|
||||
// remove defaults
|
||||
if (node.type === 'Identifier') {
|
||||
if (node.name === 'transparent' ||
|
||||
node.name === 'none' ||
|
||||
node.name === 'repeat' ||
|
||||
node.name === 'scroll') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
buffer.push(node);
|
||||
});
|
||||
|
||||
flush();
|
||||
node.children = new cssTree.List().fromArray(newValue);
|
||||
}
|
||||
|
||||
module.exports = compressBackground;
|
Reference in New Issue
Block a user