Skip to content
This repository has been archived by the owner on Aug 7, 2018. It is now read-only.

Merge configs to allow partial key/value overrides #13

Open
seothemes opened this issue Aug 1, 2018 · 0 comments
Open

Merge configs to allow partial key/value overrides #13

seothemes opened this issue Aug 1, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@seothemes
Copy link
Owner

Currently, the Child Theme Lib looks for a complete config file in the child theme. If one is not found it falls back to the default config.

A better approach would be to allow partial config overrides by merging the default config with the child theme's config - meaning that the child theme only needs to provide keys/values which differ from the default.

Example of proposed functionality:

$default = [
	'colors' => [
		'link'   => '#333333',
		'button' => '#dd3333',
		'accent' => '#dd3333',
	]
];

$override = [
	'colors' => [
		'link'   => '#555555',
	]
];

The above configs will return the following:

$config = [
	'colors' => [
		'link'   => '#555555',
		'button' => '#dd3333',
		'accent' => '#dd3333',
	]
];

However, in the current version it will only return the override:

$config = [
	'colors' => [
		'link'   => '#555555',
	]
];

This is not ideal because it requires child theme's to provide an entire config, even if there is only one difference from the defaults.

@seothemes seothemes added the enhancement New feature or request label Aug 1, 2018
@seothemes seothemes self-assigned this Aug 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant