From 5900184928803fe582c3ce26bf2844e4b097e6ea Mon Sep 17 00:00:00 2001 From: taneba Date: Wed, 19 Feb 2020 00:28:48 +0900 Subject: [PATCH 1/2] added some fixture to test css prop as an array --- test/fixtures/transpile-css-prop/code.js | 10 ++++++ test/fixtures/transpile-css-prop/output.js | 41 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/test/fixtures/transpile-css-prop/code.js b/test/fixtures/transpile-css-prop/code.js index 66358ab..0be04d7 100644 --- a/test/fixtures/transpile-css-prop/code.js +++ b/test/fixtures/transpile-css-prop/code.js @@ -106,3 +106,13 @@ const EarlyUsageComponent = p => const Thing3 = styled.div` color: blue; ` + +const styledMixin1 = css` + color: tomato; +` + +const styledMixin2 = css` + font-size: 122px; +` + +const ArrayCssHelperProp = p =>

A

diff --git a/test/fixtures/transpile-css-prop/output.js b/test/fixtures/transpile-css-prop/output.js index 49a2741..435adea 100644 --- a/test/fixtures/transpile-css-prop/output.js +++ b/test/fixtures/transpile-css-prop/output.js @@ -4,6 +4,36 @@ var _styledComponents = _interopRequireDefault(require("styled-components")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _templateObject20() { + var data = _taggedTemplateLiteral(["", ""]); + + _templateObject20 = function _templateObject20() { + return data; + }; + + return data; +} + +function _templateObject19() { + var data = _taggedTemplateLiteral(["\n font-size: 122px;\n"]); + + _templateObject19 = function _templateObject19() { + return data; + }; + + return data; +} + +function _templateObject18() { + var data = _taggedTemplateLiteral(["\n color: tomato;\n"]); + + _templateObject18 = function _templateObject18() { + return data; + }; + + return data; +} + function _templateObject17() { var data = _taggedTemplateLiteral(["color: red;"]); @@ -316,3 +346,14 @@ var EarlyUsageComponent = function EarlyUsageComponent(p) { var Thing3 = styled.div(_templateObject16()); var _StyledThing = (0, _styledComponents["default"])(Thing3)(_templateObject17()); + +var styledMixin1 = css(_templateObject18()); +var styledMixin2 = css(_templateObject19()); + +var _StyledP12 = (0, _styledComponents["default"])("p")(_templateObject20(), function (p) { + return p._css4; +}); + +var ArrayCssHelperProp = function ArrayCssHelperProp(p) { + return <_StyledP12 _css4={[styledMixin1, styledMixin2]}>A; +}; From db5d1357aee8bed4ab1d6f180d0c50fff20c2fd5 Mon Sep 17 00:00:00 2001 From: taneba Date: Wed, 19 Feb 2020 01:37:35 +0900 Subject: [PATCH 2/2] use simple value --- test/fixtures/transpile-css-prop/code.js | 4 ++-- test/fixtures/transpile-css-prop/output.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fixtures/transpile-css-prop/code.js b/test/fixtures/transpile-css-prop/code.js index 0be04d7..767e4a9 100644 --- a/test/fixtures/transpile-css-prop/code.js +++ b/test/fixtures/transpile-css-prop/code.js @@ -108,11 +108,11 @@ const Thing3 = styled.div` ` const styledMixin1 = css` - color: tomato; + color: red; ` const styledMixin2 = css` - font-size: 122px; + font-size: 10px; ` const ArrayCssHelperProp = p =>

A

diff --git a/test/fixtures/transpile-css-prop/output.js b/test/fixtures/transpile-css-prop/output.js index 435adea..c637399 100644 --- a/test/fixtures/transpile-css-prop/output.js +++ b/test/fixtures/transpile-css-prop/output.js @@ -15,7 +15,7 @@ function _templateObject20() { } function _templateObject19() { - var data = _taggedTemplateLiteral(["\n font-size: 122px;\n"]); + var data = _taggedTemplateLiteral(["\n font-size: 10px;\n"]); _templateObject19 = function _templateObject19() { return data; @@ -25,7 +25,7 @@ function _templateObject19() { } function _templateObject18() { - var data = _taggedTemplateLiteral(["\n color: tomato;\n"]); + var data = _taggedTemplateLiteral(["\n color: red;\n"]); _templateObject18 = function _templateObject18() { return data;