tiny-css-prefixer
Advanced tools
Comparing version 1.1.2 to 1.1.4
@@ -1,1 +0,1 @@ | ||
var t=/^(br|hy|us|wr|text-si|scroll-snap-t)/,e=/^(ap|us|tab-|border-e|margin-e|margin-s|padding-e|padding-s|border-sta)/,r=/^(ap|br|hy|us|wr|mas|colu|clip-|box-de|font-k|text-e|font-fe|shape-i|text-or|text-si|border-e|margin-e|margin-s|padding-e|padding-s|border-sta|background-cl|scroll-snap-t|text-decoration-)/,n={},s=function(s){return n[s]?n[s]:n[s]=1*t.test(s)|2*e.test(s)|4*r.test(s)},a=function(t,e){return"position"===t&&"sticky"===e||"background-clip"===t&&"text"===e?"-webkit-"+e+", "+e:e};export{s as prefixProperty,a as prefixValue}; | ||
var t=/^(br|hy|us|wr|text-si|scroll-snap-t)/,e=/^(ap|us|tab-|border-e|margin-e|margin-s|padding-e|padding-s|border-sta)/,r=/^(ap|br|hy|us|wr|mas|colu|clip-|box-de|font-k|text-e|font-fe|shape-i|text-or|text-si|border-e|margin-e|margin-s|padding-e|padding-s|border-sta|background-cl|scroll-snap-t|text-decoration-)/,s=/^(pos|background-cl)/,a={},n=function(s){return a[s]?a[s]:a[s]=1*t.test(s)|2*e.test(s)|4*r.test(s)},o=function(t,e){return s.test(t)?e.replace(/(sticky|text)/,"-webkit-$1, $1"):e};export{n as prefixProperty,o as prefixValue}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var t=/^(br|hy|us|wr|text-si|scroll-snap-t)/,e=/^(ap|us|tab-|border-e|margin-e|margin-s|padding-e|padding-s|border-sta)/,r=/^(ap|br|hy|us|wr|mas|colu|clip-|box-de|font-k|text-e|font-fe|shape-i|text-or|text-si|border-e|margin-e|margin-s|padding-e|padding-s|border-sta|background-cl|scroll-snap-t|text-decoration-)/,s={};exports.prefixProperty=function(i){return s[i]?s[i]:s[i]=1*t.test(i)|2*e.test(i)|4*r.test(i)},exports.prefixValue=function(t,e){return"position"===t&&"sticky"===e||"background-clip"===t&&"text"===e?"-webkit-"+e+", "+e:e}; | ||
"use strict";var t=/^(br|hy|us|wr|text-si|scroll-snap-t)/,e=/^(ap|us|tab-|border-e|margin-e|margin-s|padding-e|padding-s|border-sta)/,r=/^(ap|br|hy|us|wr|mas|colu|clip-|box-de|font-k|text-e|font-fe|shape-i|text-or|text-si|border-e|margin-e|margin-s|padding-e|padding-s|border-sta|background-cl|scroll-snap-t|text-decoration-)/,s=/^(pos|background-cl)/,a={};exports.prefixProperty=function(s){return a[s]?a[s]:a[s]=1*t.test(s)|2*e.test(s)|4*r.test(s)},exports.prefixValue=function(t,e){return s.test(t)?e.replace(/(sticky|text)/,"-webkit-$1, $1"):e}; |
{ | ||
"name": "tiny-css-prefixer", | ||
"description": "CSS prefixing helpers in less than 1KB", | ||
"version": "1.1.2", | ||
"version": "1.1.4", | ||
"main": "dist/tiny-css-prefixer.js", | ||
@@ -9,4 +9,14 @@ "module": "dist/tiny-css-prefixer.es.js", | ||
"types": "src/index.d.ts", | ||
"sideEffects": false, | ||
"author": "Phil Pluckthun <phil@kitten.sh>", | ||
"license": "MIT", | ||
"keywords": [ | ||
"css", | ||
"prefixer", | ||
"autoprefixer" | ||
], | ||
"repository": "https://github.com/kitten/tiny-css-prefixer", | ||
"bugs": { | ||
"url": "https://github.com/kitten/tiny-css-prefixer/issues" | ||
}, | ||
"files": [ | ||
@@ -28,3 +38,2 @@ "*.md", | ||
"babel-plugin-codegen": "^3.1.0", | ||
"codegen.macro": "^3.0.0", | ||
"inline-style-prefixer": "^5.1.0", | ||
@@ -35,4 +44,5 @@ "mdn-data": "^2.0.6", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-filesize": "6.2.1", | ||
"rollup-plugin-terser": "^5.2.0" | ||
} | ||
} |
@@ -41,1 +41,10 @@ # `tiny-css-prefixer` | ||
``` | ||
Additionally `prefixValue` can accept full declarations to avoid | ||
having to apply it before concatenation, which can be useful in case | ||
you're trying to minimise string operations: | ||
```js | ||
const declaration = 'position: sticky'; | ||
prefixValue(declaration, declaration); // 'position: -webkit-sticky, sticky' | ||
``` |
@@ -16,7 +16,4 @@ import /* codegen */ '../scripts/generate-prefix-map'; | ||
export const prefixValue = (prop, value) => { | ||
if ( | ||
(prop === 'position' && value === 'sticky') || | ||
(prop === 'background-clip' && value === 'text') | ||
) { | ||
return `-webkit-${value}, ${value}`; | ||
if (webkitValuePrefixRe.test(prop)) { | ||
return value.replace(/(sticky|text)/, '-webkit-$1, $1'); | ||
} | ||
@@ -23,0 +20,0 @@ |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
7797
0
50
29