react-base16-styling
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -81,3 +81,9 @@ // @flow | ||
} | ||
}) | ||
}), | ||
baseStyle: { | ||
color: 'red' | ||
}, | ||
additionalStyle: { | ||
border: 0 | ||
} | ||
}); | ||
@@ -150,1 +156,27 @@ | ||
}); | ||
test('createStyling (multiple)', t => { | ||
const styling = createStyling(getStylingFromBase16, { defaultBase16: apathy }); | ||
let customStyling = styling({ | ||
baseStyle: ({ style }) => ({ style: { ...style, color: 'blue' } }) | ||
}); | ||
t.deepEqual(customStyling(['baseStyle', 'additionalStyle']), { | ||
style: { | ||
color: 'blue', | ||
border: 0 | ||
} | ||
}); | ||
customStyling = styling({ | ||
additionalStyle: ({ style }) => ({ style: { ...style, border: 1 } }) | ||
}); | ||
t.deepEqual(customStyling(['baseStyle', 'additionalStyle']), { | ||
style: { | ||
color: 'red', | ||
border: 1 | ||
} | ||
}); | ||
}); | ||
@@ -80,3 +80,3 @@ 'use strict'; | ||
className: [prevStyling.className, styling.className].filter(Boolean).join(' '), | ||
style: (0, _extends3.default)({}, prevStyling || {}, styling || {}) | ||
style: (0, _extends3.default)({}, prevStyling.style || {}, styling.style || {}) | ||
}; | ||
@@ -101,3 +101,3 @@ }; | ||
case 'string': | ||
return defaultStyling + ' ' + customStyling; | ||
return [defaultStyling, customStyling].filter(Boolean).join(' '); | ||
case 'object': | ||
@@ -111,5 +111,5 @@ return merger({ className: customStyling, style: defaultStyling }); | ||
return (0, _extends3.default)({}, defaultStyling.apply(undefined, [styling].concat(args)), { | ||
return merger({ | ||
className: customStyling | ||
}); | ||
})(defaultStyling.apply(undefined, [styling].concat(args))); | ||
}; | ||
@@ -129,5 +129,5 @@ } | ||
return (0, _extends3.default)({}, defaultStyling.apply(undefined, [styling].concat(args)), { | ||
return merger({ | ||
style: customStyling | ||
}); | ||
})(defaultStyling.apply(undefined, [styling].concat(args))); | ||
}; | ||
@@ -143,3 +143,3 @@ } | ||
return customStyling.apply(undefined, [(0, _extends3.default)({}, styling, { | ||
return customStyling.apply(undefined, [merger(styling)({ | ||
className: defaultStyling | ||
@@ -154,3 +154,3 @@ })].concat(args)); | ||
return customStyling.apply(undefined, [(0, _extends3.default)({}, styling, { | ||
return customStyling.apply(undefined, [merger(styling)({ | ||
style: defaultStyling | ||
@@ -157,0 +157,0 @@ })].concat(args)); |
{ | ||
"name": "react-base16-styling", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "React styling with base16 color scheme support", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
28205
370