styled-velocity
Advanced tools
Comparing version 0.0.52 to 0.0.53
@@ -103,2 +103,30 @@ import { HTMLAttributes, HTMLProps } from 'react'; | ||
/** | ||
* darkCss | ||
* @returns darkCss, [at]media (prefers-color-scheme: dark) | ||
* @type string | template literal | ||
* @example | ||
* darkCss="margin: 100%;" | ||
* darkCss={` | ||
* .child {color: red;} | ||
* `} | ||
* darkCss={` | ||
* [at]media (min-width: 10em) { color: blue; } | ||
* `} | ||
*/ | ||
darkCss?: string; | ||
/** | ||
* lightCss | ||
* @returns lightCss, [at]media (prefers-color-scheme: light) | ||
* @type string | template literal | ||
* @example | ||
* lightCss="margin: 100%;" | ||
* lightCss={` | ||
* .child {color: red;} | ||
* `} | ||
* lightCss={` | ||
* [at]media (min-width: 10em) { color: blue; } | ||
* `} | ||
*/ | ||
lightCss?: string; | ||
/** | ||
* m | ||
@@ -105,0 +133,0 @@ * @returns margin css property |
@@ -19,3 +19,3 @@ "use strict"; | ||
function _templateObject() { | ||
var data = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n"]); | ||
var data = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n ", ";\n ", ";\n"]); | ||
@@ -40,4 +40,8 @@ _templateObject = function _templateObject() { | ||
}); | ||
}, function (props) { | ||
return props.lightCss && "@media (prefers-color-scheme: light) {".concat(props.lightCss, "}"); | ||
}, function (props) { | ||
return props.darkCss && "@media (prefers-color-scheme: dark) {".concat(props.darkCss, "}"); | ||
}); | ||
exports.appearanceProps = appearanceProps; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zaGFyZWQtcHJvcHMvYXBwZWFyYW5jZVByb3BzLnRzIl0sIm5hbWVzIjpbImFwcGVhcmFuY2VQcm9wcyIsImNzcyIsInByb3BzIiwiYXBwZWFyYW5jZVByb3BzQXZhaWxhYmxlIiwibWFwIiwicHJvcCIsInByb3BlcnR5IiwidmFsdWUiLCJ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hcmtDc3N9fWB9O1xuYFxuIl19 |
@@ -103,2 +103,30 @@ import { HTMLAttributes, HTMLProps } from 'react'; | ||
/** | ||
* darkCss | ||
* @returns darkCss, [at]media (prefers-color-scheme: dark) | ||
* @type string | template literal | ||
* @example | ||
* darkCss="margin: 100%;" | ||
* darkCss={` | ||
* .child {color: red;} | ||
* `} | ||
* darkCss={` | ||
* [at]media (min-width: 10em) { color: blue; } | ||
* `} | ||
*/ | ||
darkCss?: string; | ||
/** | ||
* lightCss | ||
* @returns lightCss, [at]media (prefers-color-scheme: light) | ||
* @type string | template literal | ||
* @example | ||
* lightCss="margin: 100%;" | ||
* lightCss={` | ||
* .child {color: red;} | ||
* `} | ||
* lightCss={` | ||
* [at]media (min-width: 10em) { color: blue; } | ||
* `} | ||
*/ | ||
lightCss?: string; | ||
/** | ||
* m | ||
@@ -105,0 +133,0 @@ * @returns margin css property |
@@ -19,3 +19,3 @@ "use strict"; | ||
function _templateObject() { | ||
var data = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n"]); | ||
var data = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n ", ";\n ", ";\n"]); | ||
@@ -40,4 +40,8 @@ _templateObject = function _templateObject() { | ||
}); | ||
}, function (props) { | ||
return props.lightCss && "@media (prefers-color-scheme: light) {".concat(props.lightCss, "}"); | ||
}, function (props) { | ||
return props.darkCss && "@media (prefers-color-scheme: dark) {".concat(props.darkCss, "}"); | ||
}); | ||
exports.appearanceProps = appearanceProps; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zaGFyZWQtcHJvcHMvYXBwZWFyYW5jZVByb3BzLnRzIl0sIm5hbWVzIjpbImFwcGVhcmFuY2VQcm9wcyIsImNzcyIsInByb3BzIiwiYXBwZWFyYW5jZVByb3BzQXZhaWxhYmxlIiwibWFwIiwicHJvcCIsInByb3BlcnR5IiwidmFsdWUiLCJmaWx0Z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N9fWB9O1xuYFxuIl19 |
{ | ||
"name": "styled-velocity", | ||
"version": "0.0.52", | ||
"version": "0.0.53", | ||
"description": "Styled-Velocity, a React-based styled prop and UI library to increase your velocity and help build your Design System.", | ||
@@ -5,0 +5,0 @@ "author": "Jon K. Wheeler", |
@@ -241,1 +241,58 @@ # Styled-Velocity | ||
## Polyfill | ||
In order to use this package on IE, you'll need a polyfill for `String.prototype.includes`. You can do this with loading a polyfill script from https://polyfill.io/, such as | ||
```<script src="https://polyfill.io/v3/polyfill.min.js?features=String.prototype.includes" async></script>``` | ||
### Using Next.js? | ||
With Next.js you can load polyfills another way. See https://github.com/zeit/next.js/blob/canary/examples/with-polyfills/client/polyfills.js. | ||
Add following to `client/polyfills.js` | ||
~~~js | ||
/* | ||
* This files runs at the very beginning (even before React and Next.js core) | ||
* https://github.com/zeit/next.js/blob/canary/examples/with-polyfills/client/polyfills.js | ||
*/ | ||
/* eslint no-extend-native: 0 */ | ||
// core-js comes with Next.js. So, you can import it like below | ||
import stringIncludes from 'core-js/library/fn/string/virtual/includes' | ||
// Add your polyfills | ||
String.prototype.includes = stringIncludes | ||
~~~ | ||
And then modify the `next.config.js` | ||
~~~js | ||
// next.config.js | ||
const nextConfig = { | ||
webpack(config) { | ||
/* | ||
* Add polyfills | ||
* https://github.com/zeit/next.js/blob/canary/examples/with-polyfills/next.config.js | ||
*/ | ||
const originalEntry = config.entry | ||
config.entry = async () => { | ||
const entries = await originalEntry() | ||
if (entries['main.js'] && !entries['main.js'].includes('./client/polyfills.js')) { | ||
entries['main.js'].unshift('./client/polyfills.js') | ||
} | ||
return entries | ||
} | ||
return config | ||
}, | ||
} | ||
module.exports = nextConfig | ||
~~~ |
@@ -117,2 +117,32 @@ import { HTMLAttributes, HTMLProps } from 'react' | ||
/** | ||
* darkCss | ||
* @returns darkCss, [at]media (prefers-color-scheme: dark) | ||
* @type string | template literal | ||
* @example | ||
* darkCss="margin: 100%;" | ||
* darkCss={` | ||
* .child {color: red;} | ||
* `} | ||
* darkCss={` | ||
* [at]media (min-width: 10em) { color: blue; } | ||
* `} | ||
*/ | ||
darkCss?: string | ||
/** | ||
* lightCss | ||
* @returns lightCss, [at]media (prefers-color-scheme: light) | ||
* @type string | template literal | ||
* @example | ||
* lightCss="margin: 100%;" | ||
* lightCss={` | ||
* .child {color: red;} | ||
* `} | ||
* lightCss={` | ||
* [at]media (min-width: 10em) { color: blue; } | ||
* `} | ||
*/ | ||
lightCss?: string | ||
/** | ||
* m | ||
@@ -119,0 +149,0 @@ * @returns margin css property |
@@ -13,2 +13,4 @@ import { PropsAvailablePropTypes } from '@propTypes' | ||
.filter(item => item !== null)}; | ||
${props => props.lightCss && `@media (prefers-color-scheme: light) {${props.lightCss}}`}; | ||
${props => props.darkCss && `@media (prefers-color-scheme: dark) {${props.darkCss}}`}; | ||
` |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
812170
12398
297
14