Rename to applyConfigToTheme
This commit is contained in:
parent
8c43650798
commit
9939d344e4
3 changed files with 5 additions and 5 deletions
|
|
@ -1,13 +1,13 @@
|
|||
import { test } from 'vitest'
|
||||
import { buildDesignSystem } from '../design-system'
|
||||
import { Theme } from '../theme'
|
||||
import { mergeIntoTheme } from './merge-into-theme'
|
||||
import { applyConfigToTheme } from './apply-config-to-theme'
|
||||
|
||||
test('Config values can be merged into the theme', ({ expect }) => {
|
||||
let theme = new Theme()
|
||||
let design = buildDesignSystem(theme)
|
||||
|
||||
mergeIntoTheme(design, [
|
||||
applyConfigToTheme(design, [
|
||||
{
|
||||
config: {
|
||||
theme: {
|
||||
|
|
@ -2,7 +2,7 @@ import type { DesignSystem } from '../design-system'
|
|||
import { resolveConfig, type ConfigFile } from './config/resolve-config'
|
||||
import type { ResolvedConfig } from './config/types'
|
||||
|
||||
export function mergeIntoTheme(designSystem: DesignSystem, configs: ConfigFile[]) {
|
||||
export function applyConfigToTheme(designSystem: DesignSystem, configs: ConfigFile[]) {
|
||||
let theme = resolveConfig(designSystem, configs).theme
|
||||
|
||||
for (let [path, value] of themeableValues(theme)) {
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import { substituteAtApply } from './apply'
|
||||
import { decl, rule, type AstNode } from './ast'
|
||||
import type { Candidate, NamedUtilityValue } from './candidate'
|
||||
import { applyConfigToTheme } from './compat/apply-config-to-theme'
|
||||
import { createCompatConfig } from './compat/config/create-compat-config'
|
||||
import { resolveConfig, type ConfigFile } from './compat/config/resolve-config'
|
||||
import type { ResolvedConfig, UserConfig } from './compat/config/types'
|
||||
import { darkModePlugin } from './compat/dark-mode'
|
||||
import { mergeIntoTheme } from './compat/merge-into-theme'
|
||||
import type { DesignSystem } from './design-system'
|
||||
import { createThemeFn } from './theme-fn'
|
||||
import { withAlpha, withNegative } from './utilities'
|
||||
|
|
@ -369,7 +369,7 @@ export function registerPlugins(
|
|||
// Merge the user-configured theme keys into the design system. The compat
|
||||
// config would otherwise expand into namespaces like `background-color` which
|
||||
// core utilities already read from.
|
||||
mergeIntoTheme(designSystem, userConfig)
|
||||
applyConfigToTheme(designSystem, userConfig)
|
||||
|
||||
return {
|
||||
pluginApi,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue