summaryrefslogtreecommitdiff
path: root/node_modules/postcss-clearfix/index.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:10:59 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:41:44 +0800
commitfc87c009806dcc98867f6b58efe29b042aa01dee (patch)
tree8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/postcss-clearfix/index.js
parent3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff)
node: updatemain
Diffstat (limited to 'node_modules/postcss-clearfix/index.js')
-rw-r--r--node_modules/postcss-clearfix/index.js66
1 files changed, 0 insertions, 66 deletions
diff --git a/node_modules/postcss-clearfix/index.js b/node_modules/postcss-clearfix/index.js
deleted file mode 100644
index 18f37bcd..00000000
--- a/node_modules/postcss-clearfix/index.js
+++ /dev/null
@@ -1,66 +0,0 @@
-'use strict';
-
-var postcss = require('postcss'),
- DEFAULT_OPTIONS = {
- display: 'block'
- };
-
-/**
- * Clear: fix; rule handler
- * @param {string} decl current decleration
- */
-function clearFix(decl, opts) {
-
- var origRule = decl.parent,
- ruleSelectors = origRule.selectors,
- newRule;
-
- if (decl.value !== 'fix') {
- return;
- }
-
- ruleSelectors = ruleSelectors.map(function(ruleSelector){
- return ruleSelector + ':after';
- }).join(',\n');
-
- // Insert the :after rule before the original rule
- newRule = origRule.cloneAfter({
- selector: ruleSelectors
- }).removeAll();
-
- newRule.append({
- prop: 'content',
- value: '\'\'',
- source: decl.source
- }, {
- prop: 'display',
- value: opts.display,
- source: decl.source
- }, {
- prop: 'clear',
- value: 'both',
- source: decl.source
- });
-
- // If the original rule only had clear:fix in it, remove the whole rule
- if (decl.prev() === undefined && decl.next() === undefined) {
- origRule.remove();
- } else {
- // Otherwise just remove the delcl
- decl.remove();
- }
-
-}
-
-module.exports = postcss.plugin('postcss-clearfix', function(opts) {
- opts = opts || {};
- opts = Object.assign({}, DEFAULT_OPTIONS, opts);
-
- return function(css) {
-
- css.walkDecls('clear', function(decl) {
- clearFix(decl, opts);
- });
-
- };
-});