Skip to content

Commit

Permalink
Merge changes from 1.1.3 and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Oct 22, 2019
2 parents 5ab5498 + 109a435 commit 311fc66
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions __tests__/resolveConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ test('theme values in the extend section are lazily evaluated', () => {
test('lazily evaluated values have access to the config utils', () => {
const userConfig = {
theme: {
inset: theme => theme('margin'),
shift: (theme, { negative }) => ({
...theme('spacing'),
...negative(theme('spacing')),
Expand All @@ -1083,6 +1084,10 @@ test('lazily evaluated values have access to the config utils', () => {
'3': '3px',
'4': '4px',
},
margin: (theme, { negative }) => ({
...theme('spacing'),
...negative(theme('spacing')),
}),
},
variants: {},
}
Expand All @@ -1100,6 +1105,26 @@ test('lazily evaluated values have access to the config utils', () => {
'3': '3px',
'4': '4px',
},
inset: {
'-1': '-1px',
'-2': '-2px',
'-3': '-3px',
'-4': '-4px',
'1': '1px',
'2': '2px',
'3': '3px',
'4': '4px',
},
margin: {
'-1': '-1px',
'-2': '-2px',
'-3': '-3px',
'-4': '-4px',
'1': '1px',
'2': '2px',
'3': '3px',
'4': '4px',
},
shift: {
'-1': '-1px',
'-2': '-2px',
Expand Down
2 changes: 1 addition & 1 deletion src/util/resolveConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function resolveFunctionKeys(object) {

while (val !== undefined && val !== null && index < path.length) {
val = val[path[index++]]
val = isFunction(val) ? val(resolveThemePath) : val
val = isFunction(val) ? val(resolveThemePath, configUtils) : val
}

return val === undefined ? defaultValue : val
Expand Down

0 comments on commit 311fc66

Please sign in to comment.