Socket
Socket
Sign inDemoInstall

void-css

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

void-css - npm Package Compare versions

Comparing version 1.0.26 to 1.0.27

2

package.json
{
"name": "void-css",
"version": "1.0.26",
"version": "1.0.27",
"description": "A JIT & statically compiled CSS processor",

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

@@ -13,2 +13,20 @@ const initialState = {

function styler(...args) {
return args.join(";");
}
function log(...args) {
const debug = !!window.__voidCSSDebugEnabled;
if (debug) {
return void console.log(
"« %cVoid %cCSS » [%cDebug%c]",
styler("color: #ad83fc", "font-weight: bold", "font-size: 16px"),
styler("color: #fff", "font-size: 16px"),
styler("color: lightgreen"),
styler(""),
...args,
);
}
}
const handler = {

@@ -48,4 +66,5 @@ get: function (target, prop) {

}
this.destroy = function () {
void log("Stylesheet destroyed, state reset and styles removed. (for dev) hmr issue may occur, refresh the page");
for (const element of state.usedStyleElements) {

@@ -63,2 +82,3 @@ try {

function init() {
void log("Initiated styles");
const rID = resolveID("static", id);

@@ -95,2 +115,3 @@ const style = document.getElementById(rID) || createStyleElement(rID);

function voidCSSAssembler(input) {
void log("Assembler called", input);

@@ -155,6 +176,13 @@ if (!state.initiated) {

function updateGenericDynamicStyle(rule, input) {
void log("Updating generic dynamic rule: ", rule, "input: ", input);
// Ensures that rule is only updated if new styles are available
if (!input || !rule.dependencies.some(dependency => input.hasOwnProperty(dependency.slice(1)))) {
return void log("Did not update generic dynamic rule because it has no new styles to consume.");
}
const localID = resolveID("dynamic-generic", rule.hash, id);
const css = interpolateDynamicStyles(rule, input);
const style = document.getElementById(localID) || createStyleElement(localID);
void log("New generic dynamic styles: ", css);
style.innerHTML = css;

@@ -161,0 +189,0 @@ }

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