Socket
Socket
Sign inDemoInstall

bss

Package Overview
Dependencies
0
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.9 to 1.2.10

bss.esm.js

7

bss.js

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

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

@@ -181,3 +181,3 @@ return acc

function camelCaseToHyphen(camelCase) {
return camelCase.replace(/([A-Z])/g, '-$1').toLowerCase()
return camelCase.replace(/(\B[A-Z])/g, '-$1').toLowerCase()
}

@@ -223,2 +223,3 @@

function propToString(prop, value) {
prop = prop in vendorMap ? vendorMap[prop] : prop;
return (vendorRegex.test(prop) ? '-' : '')

@@ -304,3 +305,3 @@ + (prop.charAt(0) === '-' && prop.charAt(1) === '-'

var b = chain(bss);
assign(b.__style, parse.apply(null, arguments));
input && assign(b.__style, parse.apply(null, arguments));
return b

@@ -307,0 +308,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 i={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"},o=["float"].concat(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 t=function(e,n){return void 0===n&&(n={}),function(t){return t in n?n[t]:n[t]=e(t)}};function l(t,e,n){e in t?l(t,"!"+e,n):t[e]=n}var a=Object.create(null,{}),c=Object.create(null,{}),u=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,n=t(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:"",boxShadow:"px",border:"px"});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(e,n,r,i){void 0===r&&(r="");var o={},c=[];return Object.keys(e).forEach(function(t){"@"===t.charAt(0)?c.push(t+"{"+h(e[t],n,r,i)+"}"):"object"==typeof e[t]?c=c.concat(h(e[t],n,r+t,i)):o[t]=e[t]}),Object.keys(o).length&&c.unshift(((i||" "===r.charAt(0)?"":"&")+"&"+r).replace(/&/g,n)+"{"+p(o)+"}"),c}var r=/,(?=(?:(?:[^"]*"){2})*[^"]*$)/;function p(i){return Object.keys(i).reduce(function(t,e){return t+(n=e.replace(/!/g,""),r=i[e],(u.test(n)?"-":"")+("-"===n.charAt(0)&&"-"===n.charAt(1)?n:n.replace(/([A-Z])/g,"-$1").toLowerCase())+":"+r+";");var n,r},"")}function y(t,e){return e in c?c[e]:d(t,e)}function d(t,e){return e+(isNaN(e)?"":n(t))}var e=window.document,g=e&&e.createElement("style");g&&e.head.appendChild(g);var b=g&&g.sheet,m=!1,_=Object.create(null,{}),v=[],j=0,O="b"+("000"+(46656*Math.random()|0).toString(36)).slice(-3)+("000"+(46656*Math.random()|0).toString(36)).slice(-3);function x(t,e){if(v.push(t),m)return g.textContent=v.join("\n");b&&b.insertRule(t,1<arguments.length?e:b.cssRules.length)}var A=Object.create(null);function k(t,e){var n=E(k);return f(n.__style,D.apply(null,arguments)),n}function w(t,e){Object.defineProperty(k,t,{configurable:!0,value:e})}function E(t){var e=Object.create(k,{__style:{value:t.__style},style:{enumerable:!0,get:function(){var n=this;return Object.keys(this.__style).reduce(function(t,e){return"number"!=typeof n.__style[e]&&"string"!=typeof n.__style[e]||(t[e.replace(/^!/,"")]=n.__style[e]),t},{})}}});return t===k&&(k.__style={}),e}function P(t,e,n){l(t,e.split(r).map(function(t){return(":"===(t=t.trim()).charAt(0)||"["===t.charAt(0)?"":" ")+t}).join(",&"),D(n))}function $(e){return function(t){return t||0===t?0<arguments.length&&l(this.__style,e,1===arguments.length?y(e,t):Array.prototype.slice.call(arguments).map(function(t){return d(e,t)}).join(" ")):delete this.__style[e],E(this)}}function C(t,e){h(D(e),t,"",!0).forEach(x)}function S(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(t){return S(t,e[t])});delete k[e],"function"==typeof n?(S[e]=n,Object.defineProperty(k,e,{configurable:!0,value:function(){var t=n.apply(null,arguments);return f(this.__style,t.__style),E(this)}})):(S[e]=D(n),Object.defineProperty(k,e,{configurable:!0,get:function(){return f(this.__style,D(n)),E(this)}}))}function L(t){var e,n=(e=t).charAt(0)+(e.match(/([A-Z])/g)||[]).join("").toLowerCase(),r=i[n]&&i[n]!==t?t:n;return A[r]=t,r}Object.defineProperties(k,{__style:{configurable:!0,writable:!0,value:{}},valueOf:{configurable:!0,writable:!0,value:function(){return"."+this.class}}}),w("setDebug",function(t){m=t}),w("$keyframes",function(n){var t=Object.keys(n).reduce(function(t,e){return t+e+"{"+p(D(n[e]))+"}"},"");if(t in z)return z[t];var e=O+R++;return x("@keyframes "+(z[t]=e)+"{"+t+"}"),e}),w("$media",function(t,e){t&&l(this.__style,"@media "+t,D(e));return E(this)}),w("$import",function(t){t&&x("@import "+t+";",0);return E(this)}),w("$nest",function(e,t){var n=this;1===arguments.length?Object.keys(e).forEach(function(t){return P(n.__style,t,e[t])}):e&&P(this.__style,e,t);return E(this)}),w("getSheet",function(){var t=v.join("");return v=[],_=Object.create(null,{}),j=0,t}),w("helper",S),w("css",function(e,t){1===arguments.length?Object.keys(e).forEach(function(t){return C(t,e[t])}):C(e,t);return E(this)}),w("classPrefix",O),o.forEach(function(t){var e,n=t.match(u);if(n){var r=(e=t.replace(u,"$2")).charAt(0).toLowerCase()+e.slice(1);if(-1===o.indexOf(r))return"flexDirection"===r&&(c.flex="-"+n[1].toLowerCase()+"-flex"),w(r,$(a[r]=t)),void w(L(r),k[r])}w(t,$(t)),w(L(t),k[t])}),w("content",function(t){return this.__style.content='"'+t+'"',E(this)}),Object.defineProperty(k,"class",{set:function(t){this.__class=t},get:function(){return this.__class||function(t){var e=JSON.stringify(t);if(e in _)return _[e];for(var n=O+ ++j,r=h(t,"."+n),i=0;i<r.length;i++)x(r[i]);return _[e]=n}(this.__style)}}),[":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(n){return w("$"+s(n.replace(/:/g,"")),function(t,e){return(t||e)&&l(this.__style,n+(e?"("+t+")":""),D(e||t)),E(this)})}),k.helper("$animate",function(t,e){return k.animation(k.$keyframes(e)+" "+t)});var M=t(function(t){var a,u="";return t.trim().split(/;|\n/).reduce(function(t,e){if(e=u+e.trim(),u=","===e.charAt(e.length-1)?e:"")return t;if(","===e.charAt(0))return t[a]+=e,t;var n=e.replace(/[ :]+/," ").split(" "),r=n[0],i=n.slice(1);if(!r)return t;var o="-"===r.charAt(0)&&"-"===r.charAt(1),c=o?r:s(r);return a=A[c]||c,c in S?f(t,"function"==typeof S[c]?S[c].apply(S,i).__style:S[c]):0<i.length&&l(t,a,i.map(function(t){return o?t:d(a,t)}).join(" ")),t},{})}),R=0,z={};function D(t,e){var n,r,i=arguments;if("string"==typeof t)return"string"==typeof e||"number"==typeof e?((n={})[t]=e,n):M(t);if(Array.isArray(t)&&"string"==typeof t[0]){for(var o="",c=0;c<t.length;c++)o+=t[c]+(i[c+1]||"");return M(o)}return 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 a?a[e]:e]=y(e,n)),t},{}))}return k});
!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 i={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"},o=["float"].concat(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 t=function(e,n){return void 0===n&&(n={}),function(t){return t in n?n[t]:n[t]=e(t)}};function l(t,e,n){e in t?l(t,"!"+e,n):t[e]=n}var c=Object.create(null,{}),a=Object.create(null,{}),u=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,n=t(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:"",boxShadow:"px",border:"px"});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(e,n,r,i){void 0===r&&(r="");var o={},c=[];return Object.keys(e).forEach(function(t){"@"===t.charAt(0)?c.push(t+"{"+h(e[t],n,r,i)+"}"):"object"==typeof e[t]?c=c.concat(h(e[t],n,r+t,i)):o[t]=e[t]}),Object.keys(o).length&&c.unshift(((i||" "===r.charAt(0)?"":"&")+"&"+r).replace(/&/g,n)+"{"+p(o)+"}"),c}var r=/,(?=(?:(?:[^"]*"){2})*[^"]*$)/;function p(i){return Object.keys(i).reduce(function(t,e){return t+(n=e.replace(/!/g,""),r=i[e],n=n in c?c[n]:n,(u.test(n)?"-":"")+("-"===n.charAt(0)&&"-"===n.charAt(1)?n:n.replace(/(\B[A-Z])/g,"-$1").toLowerCase())+":"+r+";");var n,r},"")}function y(t,e){return e in a?a[e]:d(t,e)}function d(t,e){return e+(isNaN(e)?"":n(t))}var e=window.document,g=e&&e.createElement("style");g&&e.head.appendChild(g);var b=g&&g.sheet,m=!1,_=Object.create(null,{}),v=[],j=0,O="b"+("000"+(46656*Math.random()|0).toString(36)).slice(-3)+("000"+(46656*Math.random()|0).toString(36)).slice(-3);function x(t,e){if(v.push(t),m)return g.textContent=v.join("\n");b&&b.insertRule(t,1<arguments.length?e:b.cssRules.length)}var A=Object.create(null);function k(t,e){var n=E(k);return t&&f(n.__style,D.apply(null,arguments)),n}function w(t,e){Object.defineProperty(k,t,{configurable:!0,value:e})}function E(t){var e=Object.create(k,{__style:{value:t.__style},style:{enumerable:!0,get:function(){var n=this;return Object.keys(this.__style).reduce(function(t,e){return"number"!=typeof n.__style[e]&&"string"!=typeof n.__style[e]||(t[e.replace(/^!/,"")]=n.__style[e]),t},{})}}});return t===k&&(k.__style={}),e}function P(t,e,n){l(t,e.split(r).map(function(t){return(":"===(t=t.trim()).charAt(0)||"["===t.charAt(0)?"":" ")+t}).join(",&"),D(n))}function $(e){return function(t){return t||0===t?0<arguments.length&&l(this.__style,e,1===arguments.length?y(e,t):Array.prototype.slice.call(arguments).map(function(t){return d(e,t)}).join(" ")):delete this.__style[e],E(this)}}function C(t,e){h(D(e),t,"",!0).forEach(x)}function S(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(t){return S(t,e[t])});delete k[e],"function"==typeof n?(S[e]=n,Object.defineProperty(k,e,{configurable:!0,value:function(){var t=n.apply(null,arguments);return f(this.__style,t.__style),E(this)}})):(S[e]=D(n),Object.defineProperty(k,e,{configurable:!0,get:function(){return f(this.__style,D(n)),E(this)}}))}function L(t){var e,n=(e=t).charAt(0)+(e.match(/([A-Z])/g)||[]).join("").toLowerCase(),r=i[n]&&i[n]!==t?t:n;return A[r]=t,r}Object.defineProperties(k,{__style:{configurable:!0,writable:!0,value:{}},valueOf:{configurable:!0,writable:!0,value:function(){return"."+this.class}}}),w("setDebug",function(t){m=t}),w("$keyframes",function(n){var t=Object.keys(n).reduce(function(t,e){return t+e+"{"+p(D(n[e]))+"}"},"");if(t in z)return z[t];var e=O+R++;return x("@keyframes "+(z[t]=e)+"{"+t+"}"),e}),w("$media",function(t,e){t&&l(this.__style,"@media "+t,D(e));return E(this)}),w("$import",function(t){t&&x("@import "+t+";",0);return E(this)}),w("$nest",function(e,t){var n=this;1===arguments.length?Object.keys(e).forEach(function(t){return P(n.__style,t,e[t])}):e&&P(this.__style,e,t);return E(this)}),w("getSheet",function(){var t=v.join("");return v=[],_=Object.create(null,{}),j=0,t}),w("helper",S),w("css",function(e,t){1===arguments.length?Object.keys(e).forEach(function(t){return C(t,e[t])}):C(e,t);return E(this)}),w("classPrefix",O),o.forEach(function(t){var e,n=t.match(u);if(n){var r=(e=t.replace(u,"$2")).charAt(0).toLowerCase()+e.slice(1);if(-1===o.indexOf(r))return"flexDirection"===r&&(a.flex="-"+n[1].toLowerCase()+"-flex"),w(r,$(c[r]=t)),void w(L(r),k[r])}w(t,$(t)),w(L(t),k[t])}),w("content",function(t){return this.__style.content='"'+t+'"',E(this)}),Object.defineProperty(k,"class",{set:function(t){this.__class=t},get:function(){return this.__class||function(t){var e=JSON.stringify(t);if(e in _)return _[e];for(var n=O+ ++j,r=h(t,"."+n),i=0;i<r.length;i++)x(r[i]);return _[e]=n}(this.__style)}}),[":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(n){return w("$"+s(n.replace(/:/g,"")),function(t,e){return(t||e)&&l(this.__style,n+(e?"("+t+")":""),D(e||t)),E(this)})}),k.helper("$animate",function(t,e){return k.animation(k.$keyframes(e)+" "+t)});var M=t(function(t){var a,u="";return t.trim().split(/;|\n/).reduce(function(t,e){if(e=u+e.trim(),u=","===e.charAt(e.length-1)?e:"")return t;if(","===e.charAt(0))return t[a]+=e,t;var n=e.replace(/[ :]+/," ").split(" "),r=n[0],i=n.slice(1);if(!r)return t;var o="-"===r.charAt(0)&&"-"===r.charAt(1),c=o?r:s(r);return a=A[c]||c,c in S?f(t,"function"==typeof S[c]?S[c].apply(S,i).__style:S[c]):0<i.length&&l(t,a,i.map(function(t){return o?t:d(a,t)}).join(" ")),t},{})}),R=0,z={};function D(t,e){var n,r,i=arguments;if("string"==typeof t)return"string"==typeof e||"number"==typeof e?((n={})[t]=e,n):M(t);if(Array.isArray(t)&&"string"==typeof t[0]){for(var o="",c=0;c<t.length;c++)o+=t[c]+(i[c+1]||"");return M(o)}return 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]=y(e,n)),t},{}))}return k});
//# sourceMappingURL=bss.min.js.map
## [Unreleased]
## 1.2.10 -
Fix vendor prefixing
Allow & ignore falsy values to `b()`
Transpile esm version to ES5 for webpack compat
## 1.2.9 -

@@ -4,0 +9,0 @@ Add `&` to `$nest` as class placeholder (like sass/less)

@@ -36,3 +36,3 @@ /* eslint no-invalid-this: 0 */

const b = chain(bss)
assign(b.__style, parse.apply(null, arguments))
input && assign(b.__style, parse.apply(null, arguments))
return b

@@ -39,0 +39,0 @@ }

@@ -58,3 +58,3 @@ export const cssProperties = ['float'].concat(Object.keys(

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

@@ -79,3 +79,3 @@ return acc

export function camelCaseToHyphen(camelCase) {
return camelCase.replace(/([A-Z])/g, '-$1').toLowerCase()
return camelCase.replace(/(\B[A-Z])/g, '-$1').toLowerCase()
}

@@ -124,2 +124,3 @@

function propToString(prop, value) {
prop = prop in vendorMap ? vendorMap[prop] : prop
return (vendorRegex.test(prop) ? '-' : '')

@@ -126,0 +127,0 @@ + (prop.charAt(0) === '-' && prop.charAt(1) === '-'

{
"name": "bss",
"version": "1.2.9",
"version": "1.2.10",
"description": "Better Style Sheets",
"main": "bss.js",
"module": "lib/index.js",
"module": "bss.esm.js",
"scripts": {

@@ -17,7 +17,7 @@ "test": "TEST=true npm run build && ospec",

"ospec": "3.0.1",
"rollup": "0.62.0",
"rollup": "0.64.1",
"rollup-plugin-buble": "0.19.2",
"rollup-plugin-filesize": "2.0.0",
"rollup-plugin-filesize": "4.0.1",
"rollup-plugin-uglify": "4.0.0"
}
}

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

[![version](https://img.shields.io/npm/v/bss.svg)]() [![gzipped](http://img.badgesize.io/porsager/bss/master/bss.js.svg?compression=gzip&label=gzipped)]() [![license](https://img.shields.io/github/license/porsager/wright.svg)]()
[![version](https://img.shields.io/npm/v/bss.svg)]() [![gzipped](http://img.badgesize.io/porsager/bss/master/bss.js.svg?compression=gzip&label=gzipped)]() [![license](https://img.shields.io/github/license/porsager/bss.svg)]()

@@ -176,3 +176,3 @@ ## 🎨 `bss`

// Or like this:
b.helper{
b.helper({
f1: b.fontSize('3rem'),

@@ -179,0 +179,0 @@ p1: b.padding('0.25rem')

@@ -35,3 +35,14 @@ import buble from 'rollup-plugin-buble'

]
}, {
input: 'lib/index.js',
output: {
file: 'bss.esm.js',
format: 'esm',
sourcemap: true
},
plugins: [
buble(),
filesize()
]
}
]

@@ -38,3 +38,5 @@ const o = require('ospec')

padding: '',
boxShadow: ''
boxShadow: '',
MozAppearance: '',
webkitOverflowScrolling: ''
}

@@ -137,2 +139,13 @@ }

o('adds vendor prefix', function() {
const cls = b({ overflowScrolling: 'none' }).class
o(b.getSheet()).equals(`.${cls}.${cls}{-webkit-overflow-scrolling:none;}`)
const cls2 = b({ appearance: 'none' }).class
o(b.getSheet()).equals(`.${cls2}.${cls2}{-moz-appearance:none;}`)
const cls3 = b('appearance none').class
o(b.getSheet()).equals(`.${cls3}.${cls3}{-moz-appearance:none;}`)
})
o('allows vendor prefix', function() {

@@ -139,0 +152,0 @@ const cls = b('-webkit-overflow-scrolling touch').class

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc