From 7c8d2d827f646b9c205e6923ddd1e02a8eb8b36c Mon Sep 17 00:00:00 2001 From: Pouya Saadeghi Date: Fri, 17 Nov 2023 01:33:05 +0330 Subject: [PATCH] fix culori import --- src/release.js | 2 +- src/theming/functions.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/release.js b/src/release.js index 3b82393fe75..6ff03ffd92c 100644 --- a/src/release.js +++ b/src/release.js @@ -1,4 +1,4 @@ -import { execSync } from "child_process" +const { execSync } = require("child_process") // available flags: // npm run release -- --alpha diff --git a/src/theming/functions.js b/src/theming/functions.js index afd0ca34ceb..8d3d839aa90 100644 --- a/src/theming/functions.js +++ b/src/theming/functions.js @@ -1,10 +1,10 @@ const colorNames = require("./colorNames") const themeDefaults = require("./themeDefaults") -const { toGamut, interpolate, wcagContrast } = require("culori") +const { toGamut, interpolate, wcagContrast } = require("culori/require") -const cutNumber = (number) => (number ? +number.toFixed(6) : 0); -const toGamutOKLCH = toGamut("oklch"); +const cutNumber = (number) => (number ? +number.toFixed(6) : 0) +const toGamutOKLCH = toGamut("oklch") module.exports = { isDark: (color) => { @@ -37,7 +37,7 @@ module.exports = { const resultObj = {} Object.entries(input).forEach(([rule, value]) => { - if (Object.hasOwn(colorNames,rule)) { + if (Object.hasOwn(colorNames, rule)) { const colorObj = toGamutOKLCH(value) resultObj[colorNames[rule]] = this.colorObjToString(colorObj) } else { @@ -128,7 +128,7 @@ module.exports = { }) // add other custom styles - if (!Object.hasOwn(colorNames,rule)) { + if (!Object.hasOwn(colorNames, rule)) { resultObj[rule] = value } })