postcss-utilities
Advanced tools
Comparing version 0.5.1 to 0.6.0
# Change Log | ||
# v0.6.0 | ||
- Simplify Sticky Footer utility | ||
# v0.5.1 | ||
@@ -4,0 +8,0 @@ |
12
index.js
@@ -30,3 +30,2 @@ var postcss = require('postcss'); | ||
var stickyFooter = require('./lib/sticky-footer'); | ||
var stickyFooterFluid = require('./lib/sticky-footer-fluid'); | ||
var textHide = require('./lib/text-hide'); | ||
@@ -238,11 +237,4 @@ var textStroke = require('./lib/text-stroke'); | ||
case 'sticky-footer': | ||
if (args.length === 1 || args.length === 2) { | ||
stickyFooterFluid(util, args); | ||
} else if (args.length === 3 || args.length === 4) { | ||
if (args[1] === 'fixed') { | ||
// switch args to keep sticky-footer.js | ||
args[1] = args[2]; | ||
args[2] = args[3]; | ||
stickyFooter(util, args); | ||
} | ||
if (args.length === 2 || args.length === 3) { | ||
stickyFooter(util, args); | ||
} else { | ||
@@ -249,0 +241,0 @@ result.warn('Invalid number of parameters for Sticky ' + |
@@ -7,5 +7,6 @@ /** | ||
var father = decl.parent; | ||
var ruleSelectors = father.selectors; | ||
var height = args[1].trim(); | ||
var wrapperSelector = '.wrapper'; | ||
var wrapperSelector = 'body'; | ||
@@ -16,5 +17,32 @@ if (args[2]) { | ||
father.remove(current); | ||
father.cloneBefore(father); | ||
current.replaceWith( | ||
{ | ||
prop: 'position', | ||
value: 'absolute', | ||
source: decl.source | ||
}, | ||
{ | ||
prop: 'left', | ||
value: 0, | ||
source: decl.source | ||
}, | ||
{ | ||
prop: 'bottom', | ||
value: 0, | ||
source: decl.source | ||
}, | ||
{ | ||
prop: 'height', | ||
value: height, | ||
source: decl.source | ||
}, | ||
{ | ||
prop: 'width', | ||
value: '100%', | ||
source: decl.source | ||
} | ||
); | ||
father.cloneBefore(); | ||
father.prev().walkDecls(function (node) { | ||
@@ -25,37 +53,7 @@ node.remove(); | ||
father.prev().append({ | ||
prop: 'display', | ||
value: 'block' | ||
}, { | ||
prop: 'content', | ||
value: '\"\"' | ||
}, { | ||
prop: 'height', | ||
value: height | ||
}); | ||
var ruleSelectors = father.selectors; | ||
ruleSelectors = ruleSelectors.map(function () { | ||
var ruleSelectors1 = wrapperSelector + ':after'; | ||
return ruleSelectors1; | ||
}); | ||
father.prev().selectors = ruleSelectors; | ||
father.prev().cloneBefore(); | ||
father.prev().prev().walkDecls(function (node) { | ||
node.remove(); | ||
}); | ||
father.prev().prev().append({ | ||
prop: 'min-height', | ||
value: '100%' | ||
}, { | ||
prop: 'margin-bottom', | ||
value: '-' + height | ||
value: height, | ||
source: decl.source | ||
}); | ||
ruleSelectors = father.selectors; | ||
ruleSelectors = ruleSelectors.map(function () { | ||
@@ -66,11 +64,3 @@ var ruleSelectors1 = wrapperSelector; | ||
father.prev().prev().selectors = ruleSelectors; | ||
father.append({ | ||
prop: 'height', | ||
value: height, | ||
source: decl.source | ||
}); | ||
decl.remove(); | ||
father.prev().selectors = ruleSelectors; | ||
}; |
{ | ||
"name": "postcss-utilities", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "PostCSS plugin to add a collection of mixins, shortcuts, helpers and tools for your CSS", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76850
2509
82