mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-12-20 03:50:07 +00:00
larry babby and threejs for glsl
This commit is contained in:
38
webGl/my-threejs-test/node_modules/htmlnano/lib/modules/mergeStyles.cjs
generated
vendored
Normal file
38
webGl/my-threejs-test/node_modules/htmlnano/lib/modules/mergeStyles.cjs
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = mergeStyles;
|
||||
var _helpers = require("../helpers.cjs");
|
||||
/* Merge multiple <style> into one */
|
||||
function mergeStyles(tree) {
|
||||
const styleNodes = {};
|
||||
tree.match({
|
||||
tag: 'style'
|
||||
}, node => {
|
||||
const nodeAttrs = node.attrs || {};
|
||||
// Skip <style scoped></style>
|
||||
// https://developer.mozilla.org/en/docs/Web/HTML/Element/style
|
||||
//
|
||||
// Also skip SRI, reasons are documented in "minifyJs" module
|
||||
if ('scoped' in nodeAttrs || 'integrity' in nodeAttrs) {
|
||||
return node;
|
||||
}
|
||||
if ((0, _helpers.isAmpBoilerplate)(node)) {
|
||||
return node;
|
||||
}
|
||||
const styleType = nodeAttrs.type || 'text/css';
|
||||
const styleMedia = nodeAttrs.media || 'all';
|
||||
const styleKey = styleType + '_' + styleMedia;
|
||||
if (styleNodes[styleKey]) {
|
||||
const styleContent = (node.content || []).join(' ');
|
||||
styleNodes[styleKey].content.push(' ' + styleContent);
|
||||
return '';
|
||||
}
|
||||
node.content = node.content || [];
|
||||
styleNodes[styleKey] = node;
|
||||
return node;
|
||||
});
|
||||
return tree;
|
||||
}
|
||||
Reference in New Issue
Block a user