Skip to content

Commit

Permalink
Merge pull request #157 from styled-components/clearfix-bug
Browse files Browse the repository at this point in the history
fix(clearFix): Fixes an issue with content being blank.
  • Loading branch information
mxstbr committed Apr 25, 2017
2 parents 7bed38c + 7c48950 commit ddc6f9e
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 81 deletions.
16 changes: 8 additions & 8 deletions docs/assets/polished.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function modularScale(steps) {
var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '1em';
var ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'perfectFourth';

if (!steps) {
if (typeof steps !== 'number') {
throw new Error('Please provide a number of steps to the modularScale helper.');
}
if (typeof ratio === 'string' && !ratioNames[ratio]) {
Expand All @@ -233,7 +233,7 @@ function modularScale(steps) {
throw new Error('Invalid value passed as base to modularScale, expected number or em string but got "' + base + '"');
}

return realBase * realRatio * steps + 'em';
return realBase * Math.pow(realRatio, steps) + 'em';
}

//
Expand Down Expand Up @@ -411,7 +411,7 @@ var taggedTemplateLiteral = function (strings, raw) {
*
* '&::after': {
* 'clear': 'both',
* 'content': '',
* 'content': '""',
* 'display': 'table'
* }
*/
Expand All @@ -422,7 +422,7 @@ function clearFix() {
var pseudoSelector = parent + '::after';
return defineProperty({}, pseudoSelector, {
'clear': 'both',
'content': '',
'content': '""',
'display': 'table'
});
}
Expand Down Expand Up @@ -1161,10 +1161,10 @@ function hslToRgb(hue, saturation, lightness) {

var hexRegex = /^#[a-fA-F0-9]{6}$/;
var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
var rgbRegex = /^rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)$/;
var rgbaRegex = /^rgba\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3}), ?([-+]?[0-9]*[.]?[0-9]+)\)$/;
var hslRegex = /^hsl\((\d{1,3}), ?(\d{1,3})%, ?(\d{1,3})%\)$/;
var hslaRegex = /^hsla\((\d{1,3}), ?(\d{1,3})%, ?(\d{1,3})%, ?([-+]?[0-9]*[.]?[0-9]+)\)$/;
var rgbRegex = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
var rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/;
var hslRegex = /^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/;
var hslaRegex = /^hsla\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/;

/**
* Returns an RgbColor or RgbaColor object. This utility function is only useful
Expand Down

0 comments on commit ddc6f9e

Please sign in to comment.