From e3576242a4e65215ed0f5289d8f5cff8537db14c Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Tue, 22 Oct 2019 12:59:42 -0400 Subject: [PATCH 1/2] Ensure all function properties receive config utils --- __tests__/resolveConfig.test.js | 25 +++++++++++++++++++++++++ src/util/resolveConfig.js | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/__tests__/resolveConfig.test.js b/__tests__/resolveConfig.test.js index b63a4831c..346710e39 100644 --- a/__tests__/resolveConfig.test.js +++ b/__tests__/resolveConfig.test.js @@ -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')), @@ -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: {}, } @@ -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', diff --git a/src/util/resolveConfig.js b/src/util/resolveConfig.js index 41e41526d..2a3dc1202 100644 --- a/src/util/resolveConfig.js +++ b/src/util/resolveConfig.js @@ -48,7 +48,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 From 109a43503f2e29cc810ef5648925c1d6b34075ea Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Tue, 22 Oct 2019 13:01:57 -0400 Subject: [PATCH 2/2] 1.1.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d8942a8ad..06410f6b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tailwindcss", - "version": "1.1.2", + "version": "1.1.3", "description": "A utility-first CSS framework for rapidly building custom user interfaces.", "license": "MIT", "main": "lib/index.js",