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

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 3.0.0-rc.1 to 3.0.0-rc.2

3

dist/bss.esm.js

@@ -301,5 +301,6 @@ var el = typeof document !== 'undefined' && document.createElement('div'); // eslint-disable-line

var content = props.out.length && props.out.map(function (x) { return x.join(':'); }).join(';');
var base = level.length && level[0][0] !== ':';
content && xs.push(
((!level.length || level[0][0] !== '&') && (!xs.selector || xs.selector.indexOf('@keyframes ')) !== 0
? '.' + name + (level.length && level[0][0] !== ':' ? ' ' : '')
? (base ? '' : '.' + name) + '.' + name + (base ? ' ' : '')
: ''

@@ -306,0 +307,0 @@ )

@@ -307,5 +307,6 @@ (function (global, factory) {

var content = props.out.length && props.out.map(function (x) { return x.join(':'); }).join(';');
var base = level.length && level[0][0] !== ':';
content && xs.push(
((!level.length || level[0][0] !== '&') && (!xs.selector || xs.selector.indexOf('@keyframes ')) !== 0
? '.' + name + (level.length && level[0][0] !== ':' ? ' ' : '')
? (base ? '' : '.' + name) + '.' + name + (base ? ' ' : '')
: ''

@@ -312,0 +313,0 @@ )

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).b=t()}(this,(function(){"use strict";var e="undefined"!=typeof document&&document.createElement("div"),t={flex:0,border:1,transform:1,"line-height":0,"box-shadow":1,"border-top":1,"border-left":1,"border-right":1,"border-bottom":1};function n(n){if(n in t)return t[n];try{return e.style[n]="1px",e.style.setProperty(n,"1px"),t[n]="1px"===e.style[n].slice(-3)}catch(e){return t[n]=!1}}var r=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,o=function(e){return e.replace(/(\B[A-Z])/g,"-$1").toLowerCase()},i=function(e){return e?e.hasOwnProperty("width")?e:i(Object.getPrototypeOf(e)):{}},u=["float"].concat(Object.keys("undefined"==typeof document?{}:i(document.documentElement.style))).filter((function(e,t,n){return-1===e.indexOf("-")&&"length"!==e&&n.indexOf(e)===t})).map((function(e){return e.match(r)?"-"+o(e):o(e)})).sort(),l=function(e,t){var n;return Object.assign(e,((n={})[t.split("-").map((function(e){return e[0]})).join("")]=t,n))},a=Object.assign(u.reduce(l,{}),["align-items","bottom","background-color","border-radius","box-shadow","background-image","color","display","float","flex-direction","font-family","font-size","height","justify-content","left","line-height","letter-spacing","margin","margin-bottom","margin-left","margin-right","margin-top","opacity","padding","padding-bottom","padding-left","padding-right","padding-top","right","top","text-align","text-decoration","text-transform","width"].reduce(l,{}));function c(e){return a[e]||e}var s="undefined"!==document&&window.document,f=function(e,t){return t?function(t){return e.indexOf(t.toLowerCase())>-1}:function(t){return e.indexOf(t)>-1}},p=f("abcdefghijklmnopqrstuvwxyz-"),d=f("abcdefghijklmnopqrstuvwxyz0123456789-_",!0),g=f("'\""),m=f(" :"),h=f(" ,)"),v=function(e){return"number"==typeof e},x=Object.create(null,{}),b=Object.create(null,{}),y=function(){return"bss"+("000000"+(Math.random()*Math.pow(36,6)|0).toString(36)).slice(-6)};function O(e){void 0===e&&(e={});var t=e.style;void 0===t&&(t=s&&s.querySelector&&s.querySelector(".bss_style")||s.createElement("style"));var r=e.prefix;void 0===r&&(r=t&&t.getAttribute("id")||y());var o=e.append;void 0===o&&(o=!0);var i={},l=[],a=[],f=O();return f.count=0,f.rules=t&&t.textContent&&t.textContent.split(f.prefix+"{}")||[],f.debug=!1,f.dev=!1,f.prefix=r,f.properties=u,f.at=function(e){return a.unshift("function"==typeof e?e:function(t){return e[t.slice(1)]||t})},f.prop=function(e){return l.unshift(e)},f.create=O,f.ssr=function(){return'<style class="bss_style" id="'+f.prefix+'">'+f.rules.join(f.prefix+"{}")+"</style>"},f.global=function(){$(j(f.apply(f,arguments).content).trim(),"__raw").forEach((function(e){return w(e.replace(/.__raw/g,"").trim())}))},f.prop((function(e){if(-1===u.indexOf(e)){if(x[e])return f.debug&&console.log(e,"prefixed to",x[e]),x[e];f.debug&&console.log(e,"not found")}return e})),f.prop(c),t&&(t.id=f.prefix),f;function b(){return this.className?this.className:(this.className=f.prefix+ ++f.count,$(j(this.content).trim(),this.className).forEach(w),this.className)}function O(e){return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];for(var o=(e||"")+t[0],u=1;u<t.length;u++){var l=n[u-1];o+=(l&&l.toString===b?l.content:Array.isArray(l)?l.map((function(e){return e.content||e})).join("\n"):l)+t[u]}if(o in i)return i[o];var a=O("\n"+o+"\n");return a.toString=a.valueOf=b,a.content=o,i[o]=a,a}}function j(e){return e.replace(/\/\/.*?(\n|$)/g,"\n").replace(/\/\*[\s\S]*?\*\//g,"")}function w(e){o&&(t&&s.head&&s.head.appendChild(t),o=!1);var n=0===e.indexOf("@import")?0:f.rules.length;if(0===n?f.rules.unshift(e):f.rules.push(e),f.dev&&t)t.textContent=f.rules.map(k).join("\n");else if(t&&t.sheet)try{t.sheet.insertRule(e,n)}catch(e){f.debug&&console.log("Ignored error:",e)}}function k(e){return e.replace(/{/g," {\n").replace(/([;{])\n*/g,"$1\n ").replace(/(.*):(.*);/g,"$1: $2;").replace(/[\s]*}/g,"\n}\n").replace(/,\s*/g,", ").replace(/@.*{[\s\S]*?}[\s]*}/g,(function(e){return e.split("\n").reduce((function(e,t,n,r){return e+(n<r.length-1?"\n":"")+(n>1&&n<r.length-2?" ":"")+t}),"")})).trim().replace("}\n\n}","}\n}")}function $(e,t){for(var n=[],r={prop:null,value:null,out:[],lean:!0,comma:0,end:0,quote:!1},o=[],i=!1,u=!1,l=!1,c=!1,s=0;s<e.length;s++)if(s>0&&c&&!d(e[s])&&(t=e.slice(1,s)+"-"+t,c=!1),c||0===s&&"."===e[s])c=!0;else if(z(e,s,e[s],r),"}"===e[s]||s===e.length-1)q(i||u||l||n,s,t,r,o),i&&!o.length&&((u||l||n).push(i.selector+"{"+i.join("")+"}"),i=!1),u&&!o.length&&((l||n).push(u.selector+"{"+u.join("")+"}"),u=!1),l&&!o.length&&(n.push(l.selector+"{"+l.join("")+"}"),l=!1),o.pop();else if("{"===e[s]){var f=e.slice(r.end,s).trim().replace(/,[\s]*/,",& ");0===f.indexOf("animation")&&r.out.push(["animation",f.slice(10)+" "+t]),q(i||u||l||n,s,t,r,o),r.prop=r.value=null,0===f.indexOf("@supports")?l=Object.assign([],{selector:f}):"@"===f[0]?u=Object.assign([],{selector:a.reduce((function(e,t){return t(e)}),f.trim())}):0===f.indexOf("animation")?i=Object.assign([],{selector:"@keyframes "+t}):o.push(f)}return n}function q(e,t,n,r,o){var i=r.out.length&&r.out.map((function(e){return e.join(":")})).join(";");i&&e.push((o.length&&"&"===o[0][0]||0===(!e.selector||e.selector.indexOf("@keyframes "))?"":"."+n+(o.length&&":"!==o[0][0]?" ":""))+o.join(" ").replace(/&/g,"."+n).replace(/ :/g,":")+"{"+i+";}"),r.end=t+1,r.out=[]}function z(e,t,r,o){!o.value&&null!==o.prop&&o.lean&&":"===r&&(o.lean=!1),!o.value&&null!==o.prop&&o.out.length&&","===r?(o.value=o.comma,o.prop=o.out[o.out.length-1][0]):!o.value&&null===o.prop&&p(r)?o.prop=t:v(o.prop)&&(t===e.length-1||!o.value&&(m(r)||o.lean&&"\n"===r))&&(o.value=t+1),function(e,t,r,o){o.value&&g(r)&&(o.quote=!o.quote);!o.quote&&null!==o.prop&&(t===e.length-1||";"===r||"}"===e[t+1]||o.lean&&","!==e[t-1]&&"\n"===r)&&(o.out.push(function(e){var t=e[0],r=e[1];t=l.reduce((function(e,t){return t(e)}),t.trim());for(var o="",i=0,u="px",a=0;a<r.length;a++){if(h(r[a])||a===r.length-1){var c=r.slice(i,a+1).trim();o+=(u&&n(t)?c.replace(/(^|[( ,])([-0-9.]+)([ ,)]|$)/g,"$1$2"+u+"$3").trim():c)+(","===r[a]?"":" "),i=a+1}"("!==r[a]&&")"!==r[a-1]||(u=0===r.slice(i,a).indexOf("translate")?"px":0===r.slice(i,a).indexOf("rotate")?"deg":"")}return[t,o.trim().replace(/[\n ]+/g," ")]}(e.slice(o.prop,t+1).match(/\s*([a-z-]+)[\s:]*([^;]+)/).slice(1))),o.end=t+1,o.comma=o.value,o.value=o.prop=null,o.lean=!0)}(e,t,r,o)}}u.forEach((function(e){var t=e.match(/-(ms|o|webkit|moz)-/g);if(t){var n=e.replace(/-(ms|o|webkit|moz)-/,"");if(-1===u.indexOf(n))return"flexDirection"===n&&(b.flex="-"+t[1].toLowerCase()+"-flex"),void(x[n]=e)}}));var j=O();return j.create=O,j}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).b=t()}(this,(function(){"use strict";var e="undefined"!=typeof document&&document.createElement("div"),t={flex:0,border:1,transform:1,"line-height":0,"box-shadow":1,"border-top":1,"border-left":1,"border-right":1,"border-bottom":1};function n(n){if(n in t)return t[n];try{return e.style[n]="1px",e.style.setProperty(n,"1px"),t[n]="1px"===e.style[n].slice(-3)}catch(e){return t[n]=!1}}var r=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,o=function(e){return e.replace(/(\B[A-Z])/g,"-$1").toLowerCase()},i=function(e){return e?e.hasOwnProperty("width")?e:i(Object.getPrototypeOf(e)):{}},u=["float"].concat(Object.keys("undefined"==typeof document?{}:i(document.documentElement.style))).filter((function(e,t,n){return-1===e.indexOf("-")&&"length"!==e&&n.indexOf(e)===t})).map((function(e){return e.match(r)?"-"+o(e):o(e)})).sort(),l=function(e,t){var n;return Object.assign(e,((n={})[t.split("-").map((function(e){return e[0]})).join("")]=t,n))},a=Object.assign(u.reduce(l,{}),["align-items","bottom","background-color","border-radius","box-shadow","background-image","color","display","float","flex-direction","font-family","font-size","height","justify-content","left","line-height","letter-spacing","margin","margin-bottom","margin-left","margin-right","margin-top","opacity","padding","padding-bottom","padding-left","padding-right","padding-top","right","top","text-align","text-decoration","text-transform","width"].reduce(l,{}));function c(e){return a[e]||e}var s="undefined"!==document&&window.document,f=function(e,t){return t?function(t){return e.indexOf(t.toLowerCase())>-1}:function(t){return e.indexOf(t)>-1}},p=f("abcdefghijklmnopqrstuvwxyz-"),d=f("abcdefghijklmnopqrstuvwxyz0123456789-_",!0),g=f("'\""),m=f(" :"),h=f(" ,)"),v=function(e){return"number"==typeof e},x=Object.create(null,{}),b=Object.create(null,{}),y=function(){return"bss"+("000000"+(Math.random()*Math.pow(36,6)|0).toString(36)).slice(-6)};function O(e){void 0===e&&(e={});var t=e.style;void 0===t&&(t=s&&s.querySelector&&s.querySelector(".bss_style")||s.createElement("style"));var r=e.prefix;void 0===r&&(r=t&&t.getAttribute("id")||y());var o=e.append;void 0===o&&(o=!0);var i={},l=[],a=[],f=O();return f.count=0,f.rules=t&&t.textContent&&t.textContent.split(f.prefix+"{}")||[],f.debug=!1,f.dev=!1,f.prefix=r,f.properties=u,f.at=function(e){return a.unshift("function"==typeof e?e:function(t){return e[t.slice(1)]||t})},f.prop=function(e){return l.unshift(e)},f.create=O,f.ssr=function(){return'<style class="bss_style" id="'+f.prefix+'">'+f.rules.join(f.prefix+"{}")+"</style>"},f.global=function(){$(j(f.apply(f,arguments).content).trim(),"__raw").forEach((function(e){return w(e.replace(/.__raw/g,"").trim())}))},f.prop((function(e){if(-1===u.indexOf(e)){if(x[e])return f.debug&&console.log(e,"prefixed to",x[e]),x[e];f.debug&&console.log(e,"not found")}return e})),f.prop(c),t&&(t.id=f.prefix),f;function b(){return this.className?this.className:(this.className=f.prefix+ ++f.count,$(j(this.content).trim(),this.className).forEach(w),this.className)}function O(e){return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];for(var o=(e||"")+t[0],u=1;u<t.length;u++){var l=n[u-1];o+=(l&&l.toString===b?l.content:Array.isArray(l)?l.map((function(e){return e.content||e})).join("\n"):l)+t[u]}if(o in i)return i[o];var a=O("\n"+o+"\n");return a.toString=a.valueOf=b,a.content=o,i[o]=a,a}}function j(e){return e.replace(/\/\/.*?(\n|$)/g,"\n").replace(/\/\*[\s\S]*?\*\//g,"")}function w(e){o&&(t&&s.head&&s.head.appendChild(t),o=!1);var n=0===e.indexOf("@import")?0:f.rules.length;if(0===n?f.rules.unshift(e):f.rules.push(e),f.dev&&t)t.textContent=f.rules.map(k).join("\n");else if(t&&t.sheet)try{t.sheet.insertRule(e,n)}catch(e){f.debug&&console.log("Ignored error:",e)}}function k(e){return e.replace(/{/g," {\n").replace(/([;{])\n*/g,"$1\n ").replace(/(.*):(.*);/g,"$1: $2;").replace(/[\s]*}/g,"\n}\n").replace(/,\s*/g,", ").replace(/@.*{[\s\S]*?}[\s]*}/g,(function(e){return e.split("\n").reduce((function(e,t,n,r){return e+(n<r.length-1?"\n":"")+(n>1&&n<r.length-2?" ":"")+t}),"")})).trim().replace("}\n\n}","}\n}")}function $(e,t){for(var n=[],r={prop:null,value:null,out:[],lean:!0,comma:0,end:0,quote:!1},o=[],i=!1,u=!1,l=!1,c=!1,s=0;s<e.length;s++)if(s>0&&c&&!d(e[s])&&(t=e.slice(1,s)+"-"+t,c=!1),c||0===s&&"."===e[s])c=!0;else if(z(e,s,e[s],r),"}"===e[s]||s===e.length-1)q(i||u||l||n,s,t,r,o),i&&!o.length&&((u||l||n).push(i.selector+"{"+i.join("")+"}"),i=!1),u&&!o.length&&((l||n).push(u.selector+"{"+u.join("")+"}"),u=!1),l&&!o.length&&(n.push(l.selector+"{"+l.join("")+"}"),l=!1),o.pop();else if("{"===e[s]){var f=e.slice(r.end,s).trim().replace(/,[\s]*/,",& ");0===f.indexOf("animation")&&r.out.push(["animation",f.slice(10)+" "+t]),q(i||u||l||n,s,t,r,o),r.prop=r.value=null,0===f.indexOf("@supports")?l=Object.assign([],{selector:f}):"@"===f[0]?u=Object.assign([],{selector:a.reduce((function(e,t){return t(e)}),f.trim())}):0===f.indexOf("animation")?i=Object.assign([],{selector:"@keyframes "+t}):o.push(f)}return n}function q(e,t,n,r,o){var i=r.out.length&&r.out.map((function(e){return e.join(":")})).join(";"),u=o.length&&":"!==o[0][0];i&&e.push((o.length&&"&"===o[0][0]||0===(!e.selector||e.selector.indexOf("@keyframes "))?"":(u?"":"."+n)+"."+n+(u?" ":""))+o.join(" ").replace(/&/g,"."+n).replace(/ :/g,":")+"{"+i+";}"),r.end=t+1,r.out=[]}function z(e,t,r,o){!o.value&&null!==o.prop&&o.lean&&":"===r&&(o.lean=!1),!o.value&&null!==o.prop&&o.out.length&&","===r?(o.value=o.comma,o.prop=o.out[o.out.length-1][0]):!o.value&&null===o.prop&&p(r)?o.prop=t:v(o.prop)&&(t===e.length-1||!o.value&&(m(r)||o.lean&&"\n"===r))&&(o.value=t+1),function(e,t,r,o){o.value&&g(r)&&(o.quote=!o.quote);!o.quote&&null!==o.prop&&(t===e.length-1||";"===r||"}"===e[t+1]||o.lean&&","!==e[t-1]&&"\n"===r)&&(o.out.push(function(e){var t=e[0],r=e[1];t=l.reduce((function(e,t){return t(e)}),t.trim());for(var o="",i=0,u="px",a=0;a<r.length;a++){if(h(r[a])||a===r.length-1){var c=r.slice(i,a+1).trim();o+=(u&&n(t)?c.replace(/(^|[( ,])([-0-9.]+)([ ,)]|$)/g,"$1$2"+u+"$3").trim():c)+(","===r[a]?"":" "),i=a+1}"("!==r[a]&&")"!==r[a-1]||(u=0===r.slice(i,a).indexOf("translate")?"px":0===r.slice(i,a).indexOf("rotate")?"deg":"")}return[t,o.trim().replace(/[\n ]+/g," ")]}(e.slice(o.prop,t+1).match(/\s*([a-z-]+)[\s:]*([^;]+)/).slice(1))),o.end=t+1,o.comma=o.value,o.value=o.prop=null,o.lean=!0)}(e,t,r,o)}}u.forEach((function(e){var t=e.match(/-(ms|o|webkit|moz)-/g);if(t){var n=e.replace(/-(ms|o|webkit|moz)-/,"");if(-1===u.indexOf(n))return"flexDirection"===n&&(b.flex="-"+t[1].toLowerCase()+"-flex"),void(x[n]=e)}}));var j=O();return j.create=O,j}));
//# sourceMappingURL=bss.min.js.map

@@ -214,5 +214,6 @@ import px from './px.js'

const content = props.out.length && props.out.map(x => x.join(':')).join(';')
const base = level.length && level[0][0] !== ':'
content && xs.push(
((!level.length || level[0][0] !== '&') && (!xs.selector || xs.selector.indexOf('@keyframes ')) !== 0
? '.' + name + (level.length && level[0][0] !== ':' ? ' ' : '')
? (base ? '' : '.' + name) + '.' + name + (base ? ' ' : '')
: ''

@@ -219,0 +220,0 @@ )

{
"name": "bss",
"version": "3.0.0-rc.1",
"version": "3.0.0-rc.2",
"description": "Better Style Sheets",

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

@@ -101,3 +101,3 @@ const { t, ot, not } = require('./test')

b.rules.pop(),
cn() + ':hover{opacity:0.5;}'
cn() + cn() + ':hover{opacity:0.5;}'
]

@@ -114,3 +114,3 @@ })

b.rules.pop(),
cn() + '{transform:translateY(20px);rotate:(sdfk);}'
cn() + cn() + '{transform:translateY(20px);rotate:(sdfk);}'
]

@@ -127,3 +127,3 @@ })

b.rules.pop(),
cn() + '{transform:translateY(20px) rotate(sdfk);}'
cn() + cn() + '{transform:translateY(20px) rotate(sdfk);}'
]

@@ -144,3 +144,3 @@ })

b.rules.pop(),
cn() + '{position:absolute;position:absolute;position:absolute;'
cn() + cn() + '{position:absolute;position:absolute;position:absolute;'
+ 'position:absolute;position:absolute;position:absolute;}'

@@ -156,3 +156,3 @@ ]

b.rules.pop(),
cn() + '{position:absolute;transform:translate(-50%, -50%) rotate(-45deg);}'
cn() + cn() + '{position:absolute;transform:translate(-50%, -50%) rotate(-45deg);}'
]

@@ -168,3 +168,3 @@ })

b.rules.pop(),
cn() + '{position:absolute;transform:translate(-50%, -50%) rotate(-45deg);}'
cn() + cn() + '{position:absolute;transform:translate(-50%, -50%) rotate(-45deg);}'
]

@@ -191,2 +191,15 @@ })

@media screen and (min-width: 900px) {
padding: 1rem 3rem;
}
`.toString()
return [
b.rules.pop(),
'@media screen and (min-width: 900px){' + cn() + cn() + '{padding:1rem 3rem;}}'
]
})
t('@media nest', () => {
b`
@media screen and (min-width: 900px) {
article {

@@ -279,3 +292,3 @@ padding: 1rem 3rem;

b.rules.pop(),
cn() + '{'
cn() + cn() + '{'
+ 'background-color:rgba(200,200,200,0.5);'

@@ -299,3 +312,3 @@ + 'border:10px solid rgb(255,0,0);'

'@keyframes ' + b.prefix + b.count + '{from{margin-bottom:0px;}50%{margin-top:50px;}to{margin-top:100px;}}'
+ cn() + '{animation:1s ' + b.prefix + b.count + ';}'
+ cn() + cn() + '{animation:1s ' + b.prefix + b.count + ';}'
]

@@ -312,3 +325,3 @@ })

b.rules.pop(),
cn() + '{background-color:red;color:white;}'
cn() + cn() + '{background-color:red;color:white;}'
]

@@ -326,3 +339,3 @@ })

b.rules.pop(),
cn() + '{background-color:red;color:white;}'
cn() + cn() + '{background-color:red;color:white;}'
]

@@ -340,4 +353,4 @@ })

b.rules.pop(),
cn() + '{background-color:red;border-radius:10px;color:white;}'
cn() + cn() + '{background-color:red;border-radius:10px;color:white;}'
]
})

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc