@blacksquareui/compiler
Version:
This is a package for creating css file from classes
143 lines • 4.5 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fakeConfig = exports.getConfig = void 0;
const node_fs_1 = require("node:fs");
const node_util_1 = require("node:util");
const getConfig = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (configFileName = "BlackSquareUI.json") {
try {
return JSON.parse(yield (0, node_util_1.promisify)(node_fs_1.readFile)(configFileName, 'utf-8'));
}
catch (error) {
return false;
}
});
exports.getConfig = getConfig;
const fakeConfig = () => {
return {
"content": {
"sourceDir": "src",
"fileExtension": "tsx",
"outputFile": "assets/css/index.css"
},
"settings": {
"unit": "rem"
},
"screens": [
{
"name": "sm",
"size": "640px"
}
],
"props": [
{
"name": "margin",
"type": "range",
"property": "margin",
"direction": [
"",
"-top",
"-right",
"-bottom",
"-left"
],
"val": 1,
"min": 0,
"max": 3,
"step": 0.1
},
{
"name": "padding",
"type": "range",
"property": "padding",
"direction": [
"",
"-top",
"-right",
"-bottom",
"-left"
],
"val": 1,
"min": 0,
"max": 3,
"step": 0.1
},
{
"name": "border-width",
"type": "range",
"property": "border-width",
"direction": [
""
],
"val": 0.1,
"min": 0,
"max": 1,
"step": 0.01
},
{
"name": "border-radius",
"type": "range",
"property": "border-radius",
"direction": [
""
],
"val": 0.1,
"min": 0,
"max": 3,
"step": 0.01
},
{
"name": "background-color-primary",
"type": "color",
"property": "background-color",
"val": "black"
},
{
"name": "background-color-success",
"type": "color",
"property": "background-color",
"val": "blue"
},
{
"name": "background-color-danger",
"type": "color",
"property": "background-color",
"val": "red"
},
{
"name": "border-color",
"type": "color",
"property": "border-color",
"val": "black"
},
{
"name": "text-color-primary",
"type": "color",
"property": "color",
"val": "black"
},
{
"name": "text-color-success",
"type": "color",
"property": "color",
"val": "blue"
},
{
"name": "text-color-danger",
"type": "color",
"property": "color",
"val": "red"
}
]
};
};
exports.fakeConfig = fakeConfig;
//# sourceMappingURL=configReader.js.map