Socket
Socket
Sign inDemoInstall

bss

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bss - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

22

bss.js

@@ -73,3 +73,3 @@ (function (global, factory) {

if (line.startsWith(',')) {
if (line.charAt(0) === ',') {
acc[prev] += line;

@@ -91,2 +91,3 @@ return acc

var vendorMap = Object.create(null, {});
var vendorValuePrefix = Object.create(null, {});

@@ -139,3 +140,3 @@ var vendorRegex = /^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/;

else
{ acc[key in vendorMap ? vendorMap[key] : key] = addPx(key, value); }
{ acc[key in vendorMap ? vendorMap[key] : key] = formatValue(key, value); }

@@ -213,2 +214,8 @@ return acc

function formatValue(key, value) {
return value in vendorValuePrefix
? vendorValuePrefix[value]
: addPx(key, value)
}
function addPx(key, value) {

@@ -389,5 +396,9 @@ return value + (isNaN(value) ? '' : appendPx(key))

cssProperties.forEach(function (prop) {
if (vendorRegex.test(prop)) {
var vendor = prop.match(vendorRegex);
if (vendor) {
var unprefixed = lowercaseFirst(prop.replace(vendorRegex, '$2'));
if (cssProperties.indexOf(unprefixed) === -1) {
if (unprefixed === 'flexDirection')
{ vendorValuePrefix.flex = '-' + vendor[1].toLowerCase() + '-flex'; }
vendorMap[unprefixed] = prop;

@@ -433,3 +444,4 @@ setProp(unprefixed, setter(prop));

pseudos.forEach(function (name) { return setProp('$' + hyphenToCamelCase(name), function Pseudo(value, b) {
this.style[':' + name + (b ? '(' + value + ')' : '')] = parse(b || value);
if (value || b)
{ this.style[':' + name + (b ? '(' + value + ')' : '')] = parse(b || value); }
return chain(this)

@@ -445,3 +457,3 @@ }); }

this.style[prop] = arguments.length === 1
? addPx(prop, value)
? formatValue(prop, value)
: Array.prototype.slice.call(arguments).map(function (v) { return addPx(prop, v); }).join(' ');

@@ -448,0 +460,0 @@ }

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.b=e()}(this,function(){"use strict";var t={ai:"alignItems",b:"bottom",bc:"backgroundColor",br:"borderRadius",bs:"boxShadow",c:"color",d:"display",f:"float",fd:"flexDirection",ff:"fontFamily",fs:"fontSize",h:"height",jc:"justifyContent",l:"left",lh:"lineHeight",ls:"letterSpacing",m:"margin",mb:"marginBottom",ml:"marginLeft",mr:"marginRight",mt:"marginTop",o:"opacity",p:"padding",pb:"paddingBottom",pl:"paddingLeft",pr:"paddingRight",pt:"paddingTop",r:"right",t:"top",ta:"textAlign",td:"textDecoration",tt:"textTransform",w:"width"},e=Object.create(null),n=Object.keys(function t(e){return e.hasOwnProperty("width")?e:t(Object.getPrototypeOf(e))}(document.documentElement.style)).filter(function(t){return-1===t.indexOf("-")&&"length"!==t});var r=function(t,e){return void 0===e&&(e={}),function(n){return n in e?e[n]:e[n]=t(n)}},i=r(function(t){var n,r="";return t.replace(/;/g,"\n").split("\n").reduce(function(t,i){if(i=r+i.trim(),r=","===i.slice(-1)?i:"")return t;if(i.startsWith(","))return t[n]+=i,t;var o=i.split(/[:\s]/);if(o.length>1){var c=f(o.shift().trim());t[n=e[c]||c]=o.filter(function(t){return t}).reduce(function(t,e){return t+d(n,e.trim())+" "},"").trim()}return t},{})}),o=Object.create(null,{}),c=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/;function a(t,e){var n,r;return"string"==typeof t?"string"==typeof e||"number"==typeof e?((n={})[t]=e,n):i(t):Array.isArray(t)&&Array.isArray(t.raw)?(arguments[0]={raw:t},i(String.raw.apply(null,arguments))):t.style||(r=t,Object.keys(r).reduce(function(t,e){var n=r[e];return n||0===n||""===n?("content"===e&&'"'!==n.charAt(0)?t[e]='"'+n+'"':t[e in o?o[e]:e]=d(e,n),t):t},{}))}var u=r(function(t){var e=document.createElement("div");try{return e.style[t]="1px",e.style.setProperty(t,"1px"),"1px"===e.style[t].slice(-3)?"px":""}catch(t){return""}},{flex:""});function l(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function f(t){return t.slice("-"===t.charAt(0)?1:0).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}function s(n){var r,i=(r=n).charAt(0)+(r.match(/([A-Z])/g)||[]).join("").toLowerCase(),o=t[i]&&t[i]!==n?n:i;return e[o]=n,o}function h(t,e){return t+"{"+function(t){return Object.keys(t).reduce(function(e,n){return e+function(t,e){return(c.test(e)?"-":"")+(n=e,n.replace(/([A-Z])/g,"-$1").toLowerCase())+":"+t[e]+";";var n}(t,n)},"")}("string"==typeof e?i(e):e)+"}"}function d(t,e){return e+(isNaN(e)?"":u(t))}var p=window.document,y=Object.create(null,{}),g=p&&p.createElement("style");g&&p.head.appendChild(g);var m=g&&g.sheet,b=!1,v=[],j=0,O="b"+("000"+(46656*Math.random()|0).toString(36)).slice(-3)+("000"+(46656*Math.random()|0).toString(36)).slice(-3);function k(t,e){if(v.push(t),b)return g.textContent=v.join("\n");m&&m.insertRule(t,arguments.length>1?e:m.cssRules.length)}function w(t){var e=JSON.stringify(t);if(e in y)return y[e];for(var n=function t(e){var n={},r=[],i=!1;return Object.keys(e).forEach(function(o){"@"===o.charAt(0)?r.push(o+"{"+t(e[o])+"}"):" "===o.charAt(0)||":"===o.charAt(0)?r.push(h(".$"+o,e[o])):(n[o]=e[o],i=!0)}),i&&r.unshift(h(".$",n)),r}(t),r=O+ ++j,i=0;i<n.length;i++)k(n[i].replace(/\.\$/,"."+r));return y[e]=r,r}var A=0,x={};function $(t,e){return l($.style,a.apply(null,arguments)),S($)}function P(t,e){Object.defineProperty($,t,{configurable:!0,value:e})}function S(t){var e=Object.create($,{style:{value:t.style,enumerable:!0}});return t===$&&($.style={}),e}function C(t){return function(e){return e||0===e?arguments.length>0&&(this.style[t]=1===arguments.length?d(t,e):Array.prototype.slice.call(arguments).map(function(e){return d(t,e)}).join(" ")):delete this.style[t],S(this)}}return Object.defineProperty($,"valueOf",{configurable:!0,writable:!0,value:function(){return"."+this.class}}),$.style={},P("setDebug",function(t){b=t}),P("$keyframes",function(t){var e=Object.keys(t).reduce(function(e,n){return e+h(n,t[n].style||t[n])},"");if(e in x)return x[e];var n=O+ ++A;return x[e]=n,k("@keyframes "+n+"{"+e+"}"),n}),P("getSheet",function(){var t=v.join("");return v=[],t}),P("helper",function t(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(n){return t(n,e[n])});delete $[e];"object"==typeof n?Object.defineProperty($,e,{configurable:!0,get:function(){return l(this.style,a(n)),S(this)}}):Object.defineProperty($,e,{configurable:!0,value:function(){var t=n.apply(null,arguments);return l(this.style,t.style),S(this)}})}),P("css",function t(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(n){return t(n,e[n])});k(h(e,a(n)),0)}),P("classPrefix",O),n.forEach(function(t){if(c.test(t)){var e=(r=t.replace(c,"$2")).charAt(0).toLowerCase()+r.slice(1);if(-1===n.indexOf(e))return o[e]=t,P(e,C(t)),void P(s(e),$[e])}var r;P(t,C(t)),P(s(t),$[t])}),P("content",function(t){return this.style.content='"'+t+'"',S(this)}),Object.defineProperty($,"class",{set:function(t){this.__class=t},get:function(){return this.__class||w(this.style)}}),P("$media",function(t,e){return t&&(this.style["@media "+t]=a(e)),S(this)}),P("$nest",function(t,e){return t&&(this.style[(":"===t.charAt(0)?"":" ")+t]=a(e)),S(this)}),["active","any","checked","default","disabled","empty","enabled","first","first-child","first-of-type","fullscreen","focus","hover","indeterminate","in-range","invalid","last-child","last-of-type","left","link","only-child","only-of-type","optional","out-of-range","read-only","read-write","required","right","root","scope","target","valid","visited","dir","lang","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","after","before","first-letter","first-line","selection","backdrop","placeholder","marker","spelling-error","grammar-error"].forEach(function(t){return P("$"+f(t),function(e,n){return this.style[":"+t+(n?"("+e+")":"")]=a(n||e),S(this)})}),$.helper("$animate",function(t,e){return $.animation($.$keyframes(e)+" "+t)}),$});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.b=e()}(this,function(){"use strict";var t={ai:"alignItems",b:"bottom",bc:"backgroundColor",br:"borderRadius",bs:"boxShadow",c:"color",d:"display",f:"float",fd:"flexDirection",ff:"fontFamily",fs:"fontSize",h:"height",jc:"justifyContent",l:"left",lh:"lineHeight",ls:"letterSpacing",m:"margin",mb:"marginBottom",ml:"marginLeft",mr:"marginRight",mt:"marginTop",o:"opacity",p:"padding",pb:"paddingBottom",pl:"paddingLeft",pr:"paddingRight",pt:"paddingTop",r:"right",t:"top",ta:"textAlign",td:"textDecoration",tt:"textTransform",w:"width"},e=Object.create(null),n=Object.keys(function t(e){return e.hasOwnProperty("width")?e:t(Object.getPrototypeOf(e))}(document.documentElement.style)).filter(function(t){return-1===t.indexOf("-")&&"length"!==t});var r=function(t,e){return void 0===e&&(e={}),function(n){return n in e?e[n]:e[n]=t(n)}},i=r(function(t){var n,r="";return t.replace(/;/g,"\n").split("\n").reduce(function(t,i){if(i=r+i.trim(),r=","===i.slice(-1)?i:"")return t;if(","===i.charAt(0))return t[n]+=i,t;var o=i.split(/[:\s]/);if(o.length>1){var c=s(o.shift().trim());t[n=e[c]||c]=o.filter(function(t){return t}).reduce(function(t,e){return t+y(n,e.trim())+" "},"").trim()}return t},{})}),o=Object.create(null,{}),c=Object.create(null,{}),a=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/;function u(t,e){var n,r;return"string"==typeof t?"string"==typeof e||"number"==typeof e?((n={})[t]=e,n):i(t):Array.isArray(t)&&Array.isArray(t.raw)?(arguments[0]={raw:t},i(String.raw.apply(null,arguments))):t.style||(r=t,Object.keys(r).reduce(function(t,e){var n=r[e];return n||0===n||""===n?("content"===e&&'"'!==n.charAt(0)?t[e]='"'+n+'"':t[e in o?o[e]:e]=p(e,n),t):t},{}))}var l=r(function(t){var e=document.createElement("div");try{return e.style[t]="1px",e.style.setProperty(t,"1px"),"1px"===e.style[t].slice(-3)?"px":""}catch(t){return""}},{flex:""});function f(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function s(t){return t.slice("-"===t.charAt(0)?1:0).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}function h(n){var r,i=(r=n).charAt(0)+(r.match(/([A-Z])/g)||[]).join("").toLowerCase(),o=t[i]&&t[i]!==n?n:i;return e[o]=n,o}function d(t,e){return t+"{"+function(t){return Object.keys(t).reduce(function(e,n){return e+function(t,e){return(a.test(e)?"-":"")+(n=e,n.replace(/([A-Z])/g,"-$1").toLowerCase())+":"+t[e]+";";var n}(t,n)},"")}("string"==typeof e?i(e):e)+"}"}function p(t,e){return e in c?c[e]:y(t,e)}function y(t,e){return e+(isNaN(e)?"":l(t))}var g=window.document,m=Object.create(null,{}),b=g&&g.createElement("style");b&&g.head.appendChild(b);var v=b&&b.sheet,j=!1,O=[],x=0,w="b"+("000"+(46656*Math.random()|0).toString(36)).slice(-3)+("000"+(46656*Math.random()|0).toString(36)).slice(-3);function A(t,e){if(O.push(t),j)return b.textContent=O.join("\n");v&&v.insertRule(t,arguments.length>1?e:v.cssRules.length)}function k(t){var e=JSON.stringify(t);if(e in m)return m[e];for(var n=function t(e){var n={},r=[],i=!1;return Object.keys(e).forEach(function(o){"@"===o.charAt(0)?r.push(o+"{"+t(e[o])+"}"):" "===o.charAt(0)||":"===o.charAt(0)?r.push(d(".$"+o,e[o])):(n[o]=e[o],i=!0)}),i&&r.unshift(d(".$",n)),r}(t),r=w+ ++x,i=0;i<n.length;i++)A(n[i].replace(/\.\$/,"."+r));return m[e]=r,r}var $=0,P={};function C(t,e){return f(C.style,u.apply(null,arguments)),E(C)}function S(t,e){Object.defineProperty(C,t,{configurable:!0,value:e})}function E(t){var e=Object.create(C,{style:{value:t.style,enumerable:!0}});return t===C&&(C.style={}),e}function L(t){return function(e){return e||0===e?arguments.length>0&&(this.style[t]=1===arguments.length?p(t,e):Array.prototype.slice.call(arguments).map(function(e){return y(t,e)}).join(" ")):delete this.style[t],E(this)}}return Object.defineProperty(C,"valueOf",{configurable:!0,writable:!0,value:function(){return"."+this.class}}),C.style={},S("setDebug",function(t){j=t}),S("$keyframes",function(t){var e=Object.keys(t).reduce(function(e,n){return e+d(n,t[n].style||t[n])},"");if(e in P)return P[e];var n=w+ ++$;return P[e]=n,A("@keyframes "+n+"{"+e+"}"),n}),S("getSheet",function(){var t=O.join("");return O=[],t}),S("helper",function t(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(n){return t(n,e[n])});delete C[e];"object"==typeof n?Object.defineProperty(C,e,{configurable:!0,get:function(){return f(this.style,u(n)),E(this)}}):Object.defineProperty(C,e,{configurable:!0,value:function(){var t=n.apply(null,arguments);return f(this.style,t.style),E(this)}})}),S("css",function t(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(n){return t(n,e[n])});A(d(e,u(n)),0)}),S("classPrefix",w),n.forEach(function(t){var e,r=t.match(a);if(r){var i=(e=t.replace(a,"$2")).charAt(0).toLowerCase()+e.slice(1);if(-1===n.indexOf(i))return"flexDirection"===i&&(c.flex="-"+r[1].toLowerCase()+"-flex"),o[i]=t,S(i,L(t)),void S(h(i),C[i])}S(t,L(t)),S(h(t),C[t])}),S("content",function(t){return this.style.content='"'+t+'"',E(this)}),Object.defineProperty(C,"class",{set:function(t){this.__class=t},get:function(){return this.__class||k(this.style)}}),S("$media",function(t,e){return t&&(this.style["@media "+t]=u(e)),E(this)}),S("$nest",function(t,e){return t&&(this.style[(":"===t.charAt(0)?"":" ")+t]=u(e)),E(this)}),["active","any","checked","default","disabled","empty","enabled","first","first-child","first-of-type","fullscreen","focus","hover","indeterminate","in-range","invalid","last-child","last-of-type","left","link","only-child","only-of-type","optional","out-of-range","read-only","read-write","required","right","root","scope","target","valid","visited","dir","lang","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","after","before","first-letter","first-line","selection","backdrop","placeholder","marker","spelling-error","grammar-error"].forEach(function(t){return S("$"+s(t),function(e,n){return(e||n)&&(this.style[":"+t+(n?"("+e+")":"")]=u(n||e)),E(this)})}),C.helper("$animate",function(t,e){return C.animation(C.$keyframes(e)+" "+t)}),C});
//# sourceMappingURL=bss.min.js.map
## [Unreleased]
## 1.1.8 -
Automatically add vendor prefix to display: flex value (eg. -webkit-flex)
Fix browsers that doesn't support startsWith
## 1.1.7 -

@@ -4,0 +8,0 @@ Fix browsers that doesn't support endsWith

@@ -14,2 +14,3 @@ import keyframes from './keyframes'

hyphenToCamelCase,
vendorValuePrefix,
lowercaseFirst,

@@ -19,2 +20,3 @@ selectorBlock,

vendorRegex,
formatValue,
vendorMap,

@@ -72,5 +74,9 @@ assign,

cssProperties.forEach(prop => {
if (vendorRegex.test(prop)) {
const vendor = prop.match(vendorRegex)
if (vendor) {
const unprefixed = lowercaseFirst(prop.replace(vendorRegex, '$2'))
if (cssProperties.indexOf(unprefixed) === -1) {
if (unprefixed === 'flexDirection')
vendorValuePrefix.flex = '-' + vendor[1].toLowerCase() + '-flex'
vendorMap[unprefixed] = prop

@@ -117,3 +123,4 @@ setProp(unprefixed, setter(prop))

setProp('$' + hyphenToCamelCase(name), function Pseudo(value, b) {
this.style[':' + name + (b ? '(' + value + ')' : '')] = parse(b || value)
if (value || b)
this.style[':' + name + (b ? '(' + value + ')' : '')] = parse(b || value)
return chain(this)

@@ -129,3 +136,3 @@ })

this.style[prop] = arguments.length === 1
? addPx(prop, value)
? formatValue(prop, value)
: Array.prototype.slice.call(arguments).map(v => addPx(prop, v)).join(' ')

@@ -132,0 +139,0 @@ }

@@ -30,3 +30,3 @@ import popular from './popular'

if (line.startsWith(',')) {
if (line.charAt(0) === ',') {
acc[prev] += line

@@ -48,2 +48,3 @@ return acc

export const vendorMap = Object.create(null, {})
export const vendorValuePrefix = Object.create(null, {})

@@ -94,3 +95,3 @@ export const vendorRegex = /^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/

else
acc[key in vendorMap ? vendorMap[key] : key] = addPx(key, value)
acc[key in vendorMap ? vendorMap[key] : key] = formatValue(key, value)

@@ -178,4 +179,10 @@ return acc

export function formatValue(key, value) {
return value in vendorValuePrefix
? vendorValuePrefix[value]
: addPx(key, value)
}
export function addPx(key, value) {
return value + (isNaN(value) ? '' : appendPx(key))
}
{
"name": "bss",
"version": "1.1.7",
"version": "1.1.8",
"description": "Better Style Sheets",

@@ -15,10 +15,9 @@ "main": "bss.js",

"license": "WTFPL",
"devDependencies": {},
"dependencies": {
"ospec": "1.4.0",
"devDependencies": {
"rollup": "0.56.0",
"rollup-plugin-buble": "0.19.2",
"rollup-plugin-filesize": "1.5.0",
"rollup-plugin-uglify": "3.0.0"
"rollup-plugin-uglify": "3.0.0",
"ospec": "1.4.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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