don't use lodash (-~300ms speed)

This commit is contained in:
Henry Jameson 2024-02-09 15:52:11 +02:00
parent 79d2184afa
commit 1cfdde819b
2 changed files with 2 additions and 4 deletions

View File

@ -7,8 +7,7 @@ export default {
'Icon',
'Button',
'Input',
'PanelHeader',
'DropdownMenu'
'PanelHeader'
],
defaultRules: [
{

View File

@ -1,5 +1,4 @@
import { convert, brightness } from 'chromatism'
import merge from 'lodash.merge'
import {
alphaBlend,
getTextColor,
@ -369,7 +368,7 @@ export const init = (extraRuleset, palette) => {
// Inheriting all of the applicable rules
const existingRules = ruleset.filter(findRules({ component: component.name, ...combination, parent }))
const { directives: computedDirectives } = existingRules.reduce((acc, rule) => merge(acc, rule), {})
const computedDirectives = existingRules.map(r => r.directives).reduce((acc, directives) => ({ ...acc, ...directives }), {})
const computedRule = {
component: component.name,
...combination,