Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-vendor

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-vendor - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

5

changelog.md

@@ -0,1 +1,6 @@

## 1.2.1 / 2019-02-11
- Fix prefixing flex value for IE 10
- Workaround esm with default export
## 1.2.0 / 2019-02-10

@@ -2,0 +7,0 @@

16

dist/css-vendor.cjs.js

@@ -499,2 +499,3 @@ 'use strict';

// For server-side rendering.
var prefixedValue = '';
if (!el$1) return value; // It is a string or a number as a string like '1'.

@@ -527,9 +528,11 @@ // We want only prefixable values here.

if (transitionProperties[property]) {
el$1.style[property] = value.replace(transPropsRegExp, prefixTransitionCallback);
prefixedValue = value.replace(transPropsRegExp, prefixTransitionCallback);
} else if (el$1.style[property] === '') {
// Value with a vendor prefix.
el$1.style[property] = prefix.css + value; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
prefixedValue = prefix.css + value; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
if (value === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Return false if value not supported.
if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.
el$1.style[property] = prefixedValue; // Return false if value not supported.
if (el$1.style[property] === '') {

@@ -555,2 +558,8 @@ cache$1[cacheKey] = false;

*/
var index = {
prefix: prefix,
supportedKeyframes: supportedKeyframes,
supportedProperty: supportedProperty,
supportedValue: supportedValue
};

@@ -561,1 +570,2 @@ exports.prefix = prefix;

exports.supportedValue = supportedValue;
exports.default = index;

@@ -493,2 +493,3 @@ import isInBrowser from 'is-in-browser';

// For server-side rendering.
var prefixedValue = '';
if (!el$1) return value; // It is a string or a number as a string like '1'.

@@ -521,9 +522,11 @@ // We want only prefixable values here.

if (transitionProperties[property]) {
el$1.style[property] = value.replace(transPropsRegExp, prefixTransitionCallback);
prefixedValue = value.replace(transPropsRegExp, prefixTransitionCallback);
} else if (el$1.style[property] === '') {
// Value with a vendor prefix.
el$1.style[property] = prefix.css + value; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
prefixedValue = prefix.css + value; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
if (value === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Return false if value not supported.
if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.
el$1.style[property] = prefixedValue; // Return false if value not supported.
if (el$1.style[property] === '') {

@@ -549,3 +552,10 @@ cache$1[cacheKey] = false;

*/
var index = {
prefix: prefix,
supportedKeyframes: supportedKeyframes,
supportedProperty: supportedProperty,
supportedValue: supportedValue
};
export default index;
export { prefix, supportedKeyframes, supportedProperty, supportedValue };

@@ -522,2 +522,3 @@ (function (global, factory) {

// For server-side rendering.
var prefixedValue = '';
if (!el$1) return value; // It is a string or a number as a string like '1'.

@@ -550,9 +551,11 @@ // We want only prefixable values here.

if (transitionProperties[property]) {
el$1.style[property] = value.replace(transPropsRegExp, prefixTransitionCallback);
prefixedValue = value.replace(transPropsRegExp, prefixTransitionCallback);
} else if (el$1.style[property] === '') {
// Value with a vendor prefix.
el$1.style[property] = prefix.css + value; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
prefixedValue = prefix.css + value; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
if (value === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Return false if value not supported.
if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.
el$1.style[property] = prefixedValue; // Return false if value not supported.
if (el$1.style[property] === '') {

@@ -578,2 +581,8 @@ cache$1[cacheKey] = false;

*/
var index = {
prefix: prefix,
supportedKeyframes: supportedKeyframes,
supportedProperty: supportedProperty,
supportedValue: supportedValue
};

@@ -584,2 +593,3 @@ exports.prefix = prefix;

exports.supportedValue = supportedValue;
exports.default = index;

@@ -586,0 +596,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

2

dist/css-vendor.min.js

@@ -1,1 +0,1 @@

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).cssVendor={})}(this,function(e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType,n="",o="",i="";if(t){var s={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},u=document.createElement("p").style;for(var f in s)if(f+"Transform"in u){n=f,o=s[f];break}"Webkit"===n&&"msHyphens"in u&&(n="ms",o=s.ms),"Webkit"===n&&"-apple-trailing-word"in u&&(i="apple")}var p={js:n,css:o,vendor:i};function l(e){return function(e){if(Array.isArray(e)){for(var r=0,t=new Array(e.length);r<e.length;r++)t[r]=e[r];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c={noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===p.js?"-webkit-"+e:p.css+e)}},a=/[-\s]+(.)?/g;function d(e,r){return r?r.toUpperCase():""}function y(e){return e.replace(a,d)}function m(e){return y("-"+e)}var b,x={supportedProperty:function(e,r){return!!/^break-/.test(e)&&("Webkit"===p.js?"WebkitColumn"+m(e)in r&&p.css+"column-"+e:"Moz"===p.js&&("page"+m(e)in r&&"page-"+e))}},j={noPrefill:["text-decoration-skip-ink"],supportedProperty:function(e){return"text-decoration-skip-ink"===e&&("apple"===p.vendor?""+p.css+e:"Webkit"===p.js||"Moz"===p.js?e:p.css+e)}},k={noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===p.js?p.css+"print-"+e:e)}},g={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},P=Object.keys(g),v=function(e){return p.css+e},w={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},h=[c,{noPrefill:["transform"],supportedProperty:function(e,r,t){return"transform"===e&&(t.transform?e:p.css+e)}},{noPrefill:["transition"],supportedProperty:function(e,r,t){return"transition"===e&&(t.transition?e:p.css+e)}},{noPrefill:["mask"],supportedProperty:function(e,r){if(!/^mask/.test(e))return!1;if("Webkit"===p.js){if(y("mask-image")in r)return e;if(p.js+m("mask-image")in r)return p.css+e}return e}},{noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===p.js||"ms"===p.js?p.css+e:e)}},k,j,x,{supportedProperty:function(e,r){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===p.js)return e;var t=e.replace("-inline","");return p.js+m(t)in r&&p.css+t}},{supportedProperty:function(e,r){return y(e)in r&&e}},{supportedProperty:function(e,r){var t=m(e);return p.js+t in r?p.css+e:"Webkit"!==p.js&&"Webkit"+t in r&&e}},{supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===p.js?""+p.css+e:e)}},{supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===p.js?p.css+"scroll-chaining":e)}},{supportedProperty:function(e,r){var t=w[e];return!!t&&(p.js+m(t)in r&&p.css+t)}},{supportedProperty:function(e,r,t){var n=t.multiple;if(P.indexOf(e)>-1){var o=g[e];if(!Array.isArray(o))return p.js+m(o)in r&&p.css+o;if(!n)return!1;for(var i=0;i<o.length;i++)if(!(p.js+m(o[0])in r))return!1;return o.map(v)}return!1}}],W=h.filter(function(e){return e.supportedProperty}).map(function(e){return e.supportedProperty}),S=h.filter(function(e){return e.noPrefill}).reduce(function(e,r){return e.push.apply(e,l(r.noPrefill)),e},[]),A={};if(t){b=document.createElement("p");var z=window.getComputedStyle(document.documentElement,"");for(var E in z)isNaN(E)||(A[z[E]]=z[E]);S.forEach(function(e){return delete A[e]})}function O(e,r){if(void 0===r&&(r={}),!b)return e;if(null!=A[e])return A[e];"transition"!==e&&"transform"!==e||(r[e]=e in b.style);for(var t=0;t<W.length&&(A[e]=W[t](e,b.style,r),!A[e]);t++);try{b.style[e]=""}catch(e){return!1}return A[e]}var M,N={},C={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},T=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function I(e,r,t){return"all"===r?"all":"all"===t?", all":r?O(r):", "+O(t)}t&&(M=document.createElement("p")),e.prefix=p,e.supportedKeyframes=function(e){return"-"===e[1]?e:"ms"===p.js?e:"@"+p.css+"keyframes"+e.substr(10)},e.supportedProperty=O,e.supportedValue=function(e,r){if(!M)return r;if("string"!=typeof r||!isNaN(parseInt(r,10)))return r;var t=e+r;if(null!=N[t])return N[t];try{M.style[e]=r}catch(e){return N[t]=!1,!1}if(C[e])M.style[e]=r.replace(T,I);else if(""===M.style[e]&&(M.style[e]=p.css+r,"-ms-flex"===r&&(M.style[e]="-ms-flexbox"),""===M.style[e]))return N[t]=!1,!1;return M.style[e]="",N[t]=r,N[t]},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).cssVendor={})}(this,function(e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType,n="",o="",i="";if(t){var s={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},u=document.createElement("p").style;for(var f in s)if(f+"Transform"in u){n=f,o=s[f];break}"Webkit"===n&&"msHyphens"in u&&(n="ms",o=s.ms),"Webkit"===n&&"-apple-trailing-word"in u&&(i="apple")}var p={js:n,css:o,vendor:i};function l(e){return"-"===e[1]?e:"ms"===p.js?e:"@"+p.css+"keyframes"+e.substr(10)}function a(e){return function(e){if(Array.isArray(e)){for(var r=0,t=new Array(e.length);r<e.length;r++)t[r]=e[r];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c={noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===p.js?"-webkit-"+e:p.css+e)}},d=/[-\s]+(.)?/g;function y(e,r){return r?r.toUpperCase():""}function m(e){return e.replace(d,y)}function b(e){return m("-"+e)}var x,j={supportedProperty:function(e,r){return!!/^break-/.test(e)&&("Webkit"===p.js?"WebkitColumn"+b(e)in r&&p.css+"column-"+e:"Moz"===p.js&&("page"+b(e)in r&&"page-"+e))}},k={noPrefill:["text-decoration-skip-ink"],supportedProperty:function(e){return"text-decoration-skip-ink"===e&&("apple"===p.vendor?""+p.css+e:"Webkit"===p.js||"Moz"===p.js?e:p.css+e)}},g={noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===p.js?p.css+"print-"+e:e)}},v={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},P=Object.keys(v),w=function(e){return p.css+e},h={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},W=[c,{noPrefill:["transform"],supportedProperty:function(e,r,t){return"transform"===e&&(t.transform?e:p.css+e)}},{noPrefill:["transition"],supportedProperty:function(e,r,t){return"transition"===e&&(t.transition?e:p.css+e)}},{noPrefill:["mask"],supportedProperty:function(e,r){if(!/^mask/.test(e))return!1;if("Webkit"===p.js){if(m("mask-image")in r)return e;if(p.js+b("mask-image")in r)return p.css+e}return e}},{noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===p.js||"ms"===p.js?p.css+e:e)}},g,k,j,{supportedProperty:function(e,r){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===p.js)return e;var t=e.replace("-inline","");return p.js+b(t)in r&&p.css+t}},{supportedProperty:function(e,r){return m(e)in r&&e}},{supportedProperty:function(e,r){var t=b(e);return p.js+t in r?p.css+e:"Webkit"!==p.js&&"Webkit"+t in r&&e}},{supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===p.js?""+p.css+e:e)}},{supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===p.js?p.css+"scroll-chaining":e)}},{supportedProperty:function(e,r){var t=h[e];return!!t&&(p.js+b(t)in r&&p.css+t)}},{supportedProperty:function(e,r,t){var n=t.multiple;if(P.indexOf(e)>-1){var o=v[e];if(!Array.isArray(o))return p.js+b(o)in r&&p.css+o;if(!n)return!1;for(var i=0;i<o.length;i++)if(!(p.js+b(o[0])in r))return!1;return o.map(w)}return!1}}],S=W.filter(function(e){return e.supportedProperty}).map(function(e){return e.supportedProperty}),A=W.filter(function(e){return e.noPrefill}).reduce(function(e,r){return e.push.apply(e,a(r.noPrefill)),e},[]),z={};if(t){x=document.createElement("p");var E=window.getComputedStyle(document.documentElement,"");for(var O in E)isNaN(O)||(z[E[O]]=E[O]);A.forEach(function(e){return delete z[e]})}function M(e,r){if(void 0===r&&(r={}),!x)return e;if(null!=z[e])return z[e];"transition"!==e&&"transform"!==e||(r[e]=e in x.style);for(var t=0;t<S.length&&(z[e]=S[t](e,x.style,r),!z[e]);t++);try{x.style[e]=""}catch(e){return!1}return z[e]}var N,C={},T={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},V=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function I(e,r,t){return"all"===r?"all":"all"===t?", all":r?M(r):", "+M(t)}function K(e,r){var t="";if(!N)return r;if("string"!=typeof r||!isNaN(parseInt(r,10)))return r;var n=e+r;if(null!=C[n])return C[n];try{N.style[e]=r}catch(e){return C[n]=!1,!1}if(T[e])t=r.replace(V,I);else if(""===N.style[e]&&("-ms-flex"===(t=p.css+r)&&(N.style[e]="-ms-flexbox"),N.style[e]=t,""===N.style[e]))return C[n]=!1,!1;return N.style[e]="",C[n]=r,C[n]}t&&(N=document.createElement("p"));var _={prefix:p,supportedKeyframes:l,supportedProperty:M,supportedValue:K};e.prefix=p,e.supportedKeyframes=l,e.supportedProperty=M,e.supportedValue=K,e.default=_,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "css-vendor",
"description": "CSS vendor prefix detection and property feature testing.",
"version": "1.2.0",
"version": "1.2.1",
"author": {

@@ -6,0 +6,0 @@ "name": "Oleg Slobodskoi",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc