Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for transpiling css prop as an array #270

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/fixtures/transpile-css-prop/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,13 @@ const EarlyUsageComponent = p => <Thing3 css="color: red;" />
const Thing3 = styled.div`
color: blue;
`

const styledMixin1 = css`
color: red;
`

const styledMixin2 = css`
font-size: 10px;
`

const ArrayCssHelperProp = p => <p css={[styledMixin1, styledMixin2]}>A</p>
41 changes: 41 additions & 0 deletions test/fixtures/transpile-css-prop/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: 10px;\n"]);

_templateObject19 = function _templateObject19() {
return data;
};

return data;
}

function _templateObject18() {
var data = _taggedTemplateLiteral(["\n color: red;\n"]);

_templateObject18 = function _templateObject18() {
return data;
};

return data;
}

function _templateObject17() {
var data = _taggedTemplateLiteral(["color: red;"]);

Expand Down Expand Up @@ -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</_StyledP12>;
};