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

Upgrade stylis #268

Merged
merged 2 commits into from
Jul 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"escape-string-regexp": "1.0.5",
"source-map": "0.5.6",
"string-hash": "1.1.1",
"stylis": "3.1.5"
"stylis": "3.2.6"
},
"devDependencies": {
"ava": "0.19.1",
Expand Down
4 changes: 3 additions & 1 deletion src/lib/style-transform.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const stylis = require('stylis')
const Stylis = require('stylis')

const stylis = new Stylis()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thysultan looks good?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM.


function disableNestingPlugin(...args) {
let [context, , , parent = [], line, column] = args
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/styles.js.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`transpile styles with attributes 1`] = `"html[data-jsx=\\"123\\"]{background-image:linear-gradient(0deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url(/static/background.svg)}p{color:blue}p{color:blue}p,a[data-jsx=\\"123\\"]{color:blue}.foo + a{color:red}body{font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif}p[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]{color:red}*[data-jsx=\\"123\\"]{color:blue}[href=\\"woot\\"][data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"] a[data-jsx=\\"123\\"] span[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"] span{background:blue}p[data-jsx=\\"123\\"] a[title=\\"'w ' ' t'\\"][data-jsx=\\"123\\"]{margin:auto}p[data-jsx=\\"123\\"] span:not(.test){color:green}p[data-jsx=\\"123\\"],h1[data-jsx=\\"123\\"]{color:blue;-webkit-animation:hahahadatajsx123 3s ease forwards infinite;animation:hahahadatajsx123 3s ease forwards infinite;-webkit-animation-name:hahahadatajsx123;animation-name:hahahadatajsx123;-webkit-animation-delay:100ms;animation-delay:100ms}p[data-jsx=\\"123\\"]{-webkit-animation:hahahadatajsx123 1s,hehehedatajsx123 2s;animation:hahahadatajsx123 1s,hehehedatajsx123 2s}p[data-jsx=\\"123\\"]:hover{color:red}p[data-jsx=\\"123\\"]::before{color:red}[data-jsx=\\"123\\"]:hover{color:red}[data-jsx=\\"123\\"]::before{color:red}[data-jsx=\\"123\\"]:hover p[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]+a[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]~a[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]>a[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]>>a[data-jsx=\\"123\\"]{color:red}@-webkit-keyframes hahahadatajsx123{from{top:0}to{top:100}}@keyframes hahahadatajsx123{from{top:0}to{top:100}}@-webkit-keyframes hehehedatajsx123{from{left:0}to{left:100}}@keyframes hehehedatajsx123{from{left:0}to{left:100}}@media (min-width:500px){.test[data-jsx=\\"123\\"]{color:red}}.test[data-jsx=\\"123\\"]{display:block}.inline-flex[data-jsx=\\"123\\"]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex}.flex[data-jsx=\\"123\\"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.test[data-jsx=\\"123\\"]{box-shadow:0 0 10px black, inset 0 0 5px black}.test[title=\\",\\"][data-jsx=\\"123\\"]{display:inline-block}.test.is-status[data-jsx=\\"123\\"] .test[data-jsx=\\"123\\"]{color:red}"`;
exports[`transpile styles with attributes 1`] = `"html[data-jsx=\\"123\\"]{background-image:linear-gradient(0deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url(/static/background.svg)}p{color:blue}p{color:blue}p,a[data-jsx=\\"123\\"]{color:blue}.foo + a{color:red}body{font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif}p[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]{color:red}*[data-jsx=\\"123\\"]{color:blue}[href=\\"woot\\"][data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"] a[data-jsx=\\"123\\"] span[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"] span{background:blue}p[data-jsx=\\"123\\"] a[title=\\"'w ' ' t'\\"][data-jsx=\\"123\\"]{margin:auto}p[data-jsx=\\"123\\"] span:not(.test){color:green}p[data-jsx=\\"123\\"],h1[data-jsx=\\"123\\"]{color:blue;-webkit-animation:hahahadatajsx123 3s ease forwards infinite;animation:hahahadatajsx123 3s ease forwards infinite;-webkit-animation-name:hahahadatajsx123;animation-name:hahahadatajsx123;-webkit-animation-delay:100ms;animation-delay:100ms}p[data-jsx=\\"123\\"]{-webkit-animation:hahahadatajsx123 1s,hehehedatajsx123 2s;animation:hahahadatajsx123 1s,hehehedatajsx123 2s}p[data-jsx=\\"123\\"]:hover{color:red}p[data-jsx=\\"123\\"]::before{color:red}[data-jsx=\\"123\\"]:hover{color:red}[data-jsx=\\"123\\"]::before{color:red}[data-jsx=\\"123\\"]:hover p[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]+a[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]~a[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]>a[data-jsx=\\"123\\"]{color:red}p[data-jsx=\\"123\\"]>>a[data-jsx=\\"123\\"]{color:red}@-webkit-keyframes hahahadatajsx123{from{top:0}to{top:100}}@keyframes hahahadatajsx123{from{top:0}to{top:100}}@-webkit-keyframes hehehedatajsx123{from{left:0}to{left:100}}@keyframes hehehedatajsx123{from{left:0}to{left:100}}@media (min-width:500px){.test[data-jsx=\\"123\\"]{color:red}}.test[data-jsx=\\"123\\"]{display:block}.inline-flex[data-jsx=\\"123\\"]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex}.flex[data-jsx=\\"123\\"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.test[data-jsx=\\"123\\"]{box-shadow:0 0 10px black, inset 0 0 5px black}.test[title=\\",\\"][data-jsx=\\"123\\"]{display:inline-block}.test.is-status[data-jsx=\\"123\\"] .test[data-jsx=\\"123\\"]{color:red}.a-selector[data-jsx=\\"123\\"]:hover,.a-selector[data-jsx=\\"123\\"]:focus{outline:none}"`;
6 changes: 6 additions & 0 deletions test/fixtures/transform.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,9 @@ test
.test.is-status .test {
color: red;
}

.a-selector:hover,
.a-selector:focus
{
outline: none;
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4702,9 +4702,9 @@ strip-json-comments@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"

stylis@3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.1.5.tgz#c585186286aaa79856c9ac62bbb38113923edda3"
stylis@3.2.6:
version "3.2.6"
resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.2.6.tgz#6291df64aae62e9f537ab24b7d8a62b2428a34e9"

supports-color@^2.0.0:
version "2.0.0"
Expand Down