-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
161 additions
and
70 deletions.
There are no files selected for viewing
22 changes: 17 additions & 5 deletions
22
...styled-components/transform/tests/fixtures/minify-css-to-use-with-transpilation/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
import styled from 'styled-components'; | ||
const Simple = styled.div`width:100%;`; | ||
const Interpolation = styled.div`content:" ${(props)=>props.text} ";`; | ||
const SpecialCharacters = styled.div`content:" ${(props)=>props.text} ";color:red;`; | ||
const Comment = styled.div`color:red;`; | ||
const Parens = styled.div`&:hover{color:blue;}`; | ||
const Simple = styled.div([ | ||
"width:100%;" | ||
]); | ||
const Interpolation = styled.div([ | ||
'content:" ', | ||
' ";' | ||
], (props)=>props.text); | ||
const SpecialCharacters = styled.div([ | ||
'content:" ', | ||
' ";color:red;' | ||
], (props)=>props.text); | ||
const Comment = styled.div([ | ||
"color:red;" | ||
]); | ||
const Parens = styled.div([ | ||
"&:hover{color:blue;}" | ||
]); |
26 changes: 20 additions & 6 deletions
26
...led-components/transform/tests/fixtures/minify-css-to-use-without-transpilation/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import styled from 'styled-components'; | ||
const Simple = styled.div`width:100%;`; | ||
const Interpolation = styled.div`content:"https://test.com/${props => props.endpoint}";`; | ||
const SpecialCharacters = styled.div`content:" ${props => props.text} ";color:red;`; | ||
const Comment = styled.div`width:100%;color:red;`; | ||
const Parens = styled.div`&:hover{color:blue;}color:red;`; | ||
const UrlComments = styled.div`color:red;background:red;border:1px solid green;`; | ||
const Simple = styled.div([ | ||
"width:100%;" | ||
]); | ||
const Interpolation = styled.div([ | ||
'content:"https://test.com/', | ||
'";' | ||
], (props)=>props.endpoint); | ||
const SpecialCharacters = styled.div([ | ||
'content:" ', | ||
' ";color:red;' | ||
], (props)=>props.text); | ||
const Comment = styled.div([ | ||
"width:100%;color:red;" | ||
]); | ||
const Parens = styled.div([ | ||
"&:hover{color:blue;}color:red;" | ||
]); | ||
const UrlComments = styled.div([ | ||
"color:red;background:red;border:1px solid green;" | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 26 additions & 30 deletions
56
...led-components/transform/tests/fixtures/transpile-template-literals-with-config/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,28 @@ | ||
"use strict"; | ||
|
||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
|
||
var _styledComponents = _interopRequireWildcard(require("styled-components")); | ||
|
||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
|
||
var Named = _styledComponents["default"].div.withConfig({ | ||
displayName: "code__Named" | ||
})(["\n width: 100%;\n"]); | ||
|
||
var NamedWithInterpolation = _styledComponents["default"].div.withConfig({ | ||
displayName: "code__NamedWithInterpolation" | ||
})(["\n color: ", ";\n"], function (color) { | ||
return props.color; | ||
}); | ||
|
||
var Wrapped = (0, _styledComponents["default"])(Inner).withConfig({ | ||
displayName: "code__Wrapped" | ||
})(["\n color: red;\n"]); | ||
|
||
var Foo = _styledComponents["default"].div.withConfig({ | ||
displayName: "code__Foo" | ||
import styled, { css, createGlobalStyle } from 'styled-components'; | ||
const Named = styled.div.withConfig({ | ||
displayName: "code__Named" | ||
})([ | ||
"\n width: 100%;\n" | ||
]); | ||
const NamedWithInterpolation = styled.div.withConfig({ | ||
displayName: "code__NamedWithInterpolation" | ||
})([ | ||
"\n color: ", | ||
";\n" | ||
], (color)=>props.color); | ||
const Wrapped = styled(Inner).withConfig({ | ||
displayName: "code__Wrapped" | ||
})([ | ||
"\n color: red;\n" | ||
]); | ||
const Foo = styled.div.withConfig({ | ||
displayName: "code__Foo" | ||
})({ | ||
color: 'green' | ||
color: 'green' | ||
}); | ||
|
||
var style = (0, _styledComponents.css)(["\n background: green;\n"]); | ||
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(["\n html {\n background: silver;\n }\n"]); | ||
const style = css([ | ||
"\n background: green;\n" | ||
]); | ||
const GlobalStyle = createGlobalStyle([ | ||
"\n html {\n background: silver;\n }\n" | ||
]); |