Comparing version 1.0.2 to 1.0.3
85
index.js
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.clientDevelopment = void 0; | ||
const lexer_1 = require("./src/compiler/lexer"); | ||
const config_1 = require("./src/config"); | ||
const defaultExtensions_1 = require("./src/extensions/defaultExtensions"); | ||
// @ts-ignore | ||
const voidDom_txt_1 = __importDefault(require("./src/runtime/voidDom.txt")); | ||
const css = ` | ||
.test, ..test2 { | ||
color: blue; | ||
background: pink; | ||
width: $test; | ||
transition: background 3s ease-in-out; | ||
height: 200px; | ||
.testing3 { | ||
--blue: orange; | ||
background: green; | ||
font-size: 5vw; | ||
color: --green?--red?--green?--blue; | ||
height: 2000px - $test; | ||
} | ||
} | ||
`; | ||
/* | ||
@media screen and (max-width: 992px) { | ||
body { | ||
background-color: $blue; | ||
&.hey { | ||
background-color: blue; | ||
&.hey { | ||
background-color: $blue; | ||
color: green; | ||
} | ||
} | ||
} | ||
} | ||
*/ | ||
/* | ||
.my-cool-css-class--, .testing2 { | ||
color: red; | ||
& .test { | ||
color: yellow; | ||
& .third { | ||
color: purple; | ||
.test { | ||
color: orange | ||
} | ||
.test2 { | ||
color: --accent-color | ||
} | ||
} | ||
& > * .fourth{color: green} | ||
} | ||
color: blue; | ||
background: $myVar; | ||
color: $myVar asdf; | ||
} | ||
.test, test2 { | ||
color: blue; | ||
background: pink; | ||
background: $test; | ||
transition: background 3s ease-in-out; | ||
height: 200px; | ||
} | ||
*/ | ||
/* const configInstance = new Config({indentationStyle: "\t"}); | ||
const compiled = compileScope(css, configInstance, [autoVar()]); | ||
//console.log(compiled?.static); | ||
console.log(compiled?.dynamic.map(v => v.css).join("\n\n\n")); */ | ||
function VoidCSS(config) { | ||
@@ -86,11 +10,2 @@ const configInstance = new config_1.Config(config ?? {}); | ||
} | ||
function clientDevelopment(compiled, id, filePath) { | ||
return `(function() { | ||
var id = "vcss-${id}"; | ||
var filePath = "${filePath}"; | ||
var compiled = ${JSON.stringify(compiled)} | ||
${voidDom_txt_1.default} | ||
})();`; | ||
} | ||
exports.clientDevelopment = clientDevelopment; | ||
exports.default = VoidCSS; |
85
index.ts
@@ -5,80 +5,4 @@ | ||
import { autoCalc, autoVar } from "./src/extensions/defaultExtensions"; | ||
// @ts-ignore | ||
import clientDom from "./src/runtime/voidDom.txt"; | ||
const css = ` | ||
.test, ..test2 { | ||
color: blue; | ||
background: pink; | ||
width: $test; | ||
transition: background 3s ease-in-out; | ||
height: 200px; | ||
.testing3 { | ||
--blue: orange; | ||
background: green; | ||
font-size: 5vw; | ||
color: --green?--red?--green?--blue; | ||
height: 2000px - $test; | ||
} | ||
} | ||
`; | ||
/* | ||
@media screen and (max-width: 992px) { | ||
body { | ||
background-color: $blue; | ||
&.hey { | ||
background-color: blue; | ||
&.hey { | ||
background-color: $blue; | ||
color: green; | ||
} | ||
} | ||
} | ||
} | ||
*/ | ||
/* | ||
.my-cool-css-class--, .testing2 { | ||
color: red; | ||
& .test { | ||
color: yellow; | ||
& .third { | ||
color: purple; | ||
.test { | ||
color: orange | ||
} | ||
.test2 { | ||
color: --accent-color | ||
} | ||
} | ||
& > * .fourth{color: green} | ||
} | ||
color: blue; | ||
background: $myVar; | ||
color: $myVar asdf; | ||
} | ||
.test, test2 { | ||
color: blue; | ||
background: pink; | ||
background: $test; | ||
transition: background 3s ease-in-out; | ||
height: 200px; | ||
} | ||
*/ | ||
/* const configInstance = new Config({indentationStyle: "\t"}); | ||
const compiled = compileScope(css, configInstance, [autoVar()]); | ||
//console.log(compiled?.static); | ||
console.log(compiled?.dynamic.map(v => v.css).join("\n\n\n")); */ | ||
function VoidCSS(config?: VoidCSSConfiguration) { | ||
@@ -90,11 +14,2 @@ const configInstance = new Config(config ?? {}); | ||
export function clientDevelopment(compiled: ReturnType<typeof compileScope>, id: string, filePath: string) { | ||
return `(function() { | ||
var id = "vcss-${id}"; | ||
var filePath = "${filePath}"; | ||
var compiled = ${JSON.stringify(compiled)} | ||
${clientDom} | ||
})();`; | ||
} | ||
export default VoidCSS; |
{ | ||
"name": "void-css", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -13,3 +13,7 @@ "main": "index.ts", | ||
}, | ||
"author": "", | ||
"exports": { | ||
".": "./index", | ||
"./vite": "./src/plugins/vite/vitePlugin" | ||
}, | ||
"author": "Jonathan Asplund", | ||
"license": "ISC", | ||
@@ -16,0 +20,0 @@ "dependencies": { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -25,4 +6,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const index_1 = __importStar(require("../../../index")); | ||
const index_1 = __importDefault(require("../../../index")); | ||
const fs_1 = __importDefault(require("fs")); | ||
const runtime_1 = require("../../runtime/runtime"); | ||
function viteVoidCSS(...args) { | ||
@@ -40,3 +22,3 @@ const compiler = (0, index_1.default)(...args); | ||
var updateDynamicStyles = ${(0, index_1.clientDevelopment)(compiler(content), Buffer.from(id, "utf-8").toString("base64"), id)} | ||
var updateDynamicStyles = ${(0, runtime_1.clientDevelopment)(compiler(content), Buffer.from(id, "utf-8").toString("base64"), id)} | ||
export default updateDynamicStyles; | ||
@@ -43,0 +25,0 @@ `; |
@@ -1,3 +0,4 @@ | ||
import VoidCSS, { clientDevelopment } from "../../../index"; | ||
import VoidCSS from "../../../index"; | ||
import fs from "fs"; | ||
import { clientDevelopment } from "../../runtime/runtime"; | ||
@@ -4,0 +5,0 @@ export default function viteVoidCSS(...args: Parameters<typeof VoidCSS>) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
88
1
7546489
2995
4