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.10 to 1.2.11

lib/TODO.md

15

bss.esm.js

@@ -95,3 +95,5 @@ var pseudos = [

var cssProperties = ['float'].concat(Object.keys(
findWidth(document.documentElement.style)
typeof document === 'undefined'
? {}
: findWidth(document.documentElement.style)
).filter(function (p) { return p.indexOf('-') === -1 && p !== 'length'; }));

@@ -237,5 +239,5 @@

var document$1 = window.document;
var styleSheet = document$1 && document$1.createElement('style');
styleSheet && document$1.head.appendChild(styleSheet);
var styleSheet = typeof document === 'object' && document.createElement('style');
styleSheet && document.head.appendChild(styleSheet);
var sheet = styleSheet && styleSheet.sheet;

@@ -263,2 +265,6 @@

function getRules() {
return rules
}
function insert(rule, index) {

@@ -332,2 +338,3 @@ rules.push(rule);

setProp('getSheet', getSheet);
setProp('getRules', getRules);
setProp('helper', helper);

@@ -334,0 +341,0 @@ setProp('css', css);

@@ -101,3 +101,5 @@ (function (global, factory) {

var cssProperties = ['float'].concat(Object.keys(
findWidth(document.documentElement.style)
typeof document === 'undefined'
? {}
: findWidth(document.documentElement.style)
).filter(function (p) { return p.indexOf('-') === -1 && p !== 'length'; }));

@@ -243,5 +245,5 @@

var document$1 = window.document;
var styleSheet = document$1 && document$1.createElement('style');
styleSheet && document$1.head.appendChild(styleSheet);
var styleSheet = typeof document === 'object' && document.createElement('style');
styleSheet && document.head.appendChild(styleSheet);
var sheet = styleSheet && styleSheet.sheet;

@@ -269,2 +271,6 @@

function getRules() {
return rules
}
function insert(rule, index) {

@@ -338,2 +344,3 @@ rules.push(rule);

setProp('getSheet', getSheet);
setProp('getRules', getRules);
setProp('helper', helper);

@@ -340,0 +347,0 @@ setProp('css', css);

@@ -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 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});
!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("undefined"==typeof document?{}: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 g="object"==typeof document&&document.createElement("style");g&&document.head.appendChild(g);var m=g&&g.sheet,b=!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),b)return g.textContent=v.join("\n");m&&m.insertRule(t,1<arguments.length?e:m.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){b=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+M++;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("getRules",function(){return v}),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 R=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},{})}),M=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):R(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 R(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.11 -
Add support for running in node
## 1.2.10 -

@@ -4,0 +7,0 @@ Fix vendor prefixing

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

getSheet,
getRules,
insert

@@ -70,2 +71,3 @@ } from './sheet'

setProp('getSheet', getSheet)
setProp('getRules', getRules)
setProp('helper', helper)

@@ -72,0 +74,0 @@ setProp('css', css)

@@ -5,5 +5,5 @@ import {

const document = window.document
const styleSheet = document && document.createElement('style')
const styleSheet = typeof document === 'object' && document.createElement('style')
styleSheet && document.head.appendChild(styleSheet)
const sheet = styleSheet && styleSheet.sheet

@@ -31,2 +31,6 @@

export function getRules() {
return rules
}
export function insert(rule, index) {

@@ -33,0 +37,0 @@ rules.push(rule)

export const cssProperties = ['float'].concat(Object.keys(
findWidth(document.documentElement.style)
typeof document === 'undefined'
? {}
: findWidth(document.documentElement.style)
).filter(p => p.indexOf('-') === -1 && p !== 'length'))

@@ -4,0 +6,0 @@

{
"name": "bss",
"version": "1.2.10",
"version": "1.2.11",
"description": "Better Style Sheets",

@@ -5,0 +5,0 @@ "main": "bss.js",

Sorry, the diff of this file is not supported yet

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