Skip to content

Commit

Permalink
fix culori import
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Nov 16, 2023
1 parent ac27546 commit 7c8d2d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/release.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execSync } from "child_process"
const { execSync } = require("child_process")

// available flags:
// npm run release -- --alpha
Expand Down
10 changes: 5 additions & 5 deletions src/theming/functions.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -128,7 +128,7 @@ module.exports = {
})

// add other custom styles
if (!Object.hasOwn(colorNames,rule)) {
if (!Object.hasOwn(colorNames, rule)) {
resultObj[rule] = value
}
})
Expand Down

0 comments on commit 7c8d2d8

Please sign in to comment.