-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
SX: Vendor prefixes via Autoprefixer #1467
Conversation
Does it work with runtime styles as well? |
d409801
to
c7a2fbd
Compare
@@ -14,11 +14,13 @@ | |||
"@adeira/murmur-hash": "^1.0.0", | |||
"@adeira/signed-source": "^1.0.0", | |||
"@babel/runtime": "^7.12.5", | |||
"autoprefixer": "^10.0.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be a part of the runtime-bundle? because it is quite huge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss do you see any issue there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true that during a build of sx-tailwind-website
in the monorepo I get warnings and increased bundle size:
/Users/michalsanger/projects/adeira/universe/node_modules/@adeira/sx/node_modules/browserslist/node.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
/Users/michalsanger/projects/adeira/universe/node_modules/@adeira/sx/node_modules/browserslist/node.js 175:18-177:7
Critical dependency: the request of a dependency is an expression
But when I tried postcss
and autoprefixer
on a standalone Next.js project everything was fine. Maybe because of next.config.js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is there some cheaper alternative for CSS-in-JS? 1 MB is really a lot. Why is it so big? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the PostCSS is designed to be used with Babel & Webpack, not during a runtime. I'll try to use https://github.com/robinweser/inline-style-prefixer in a new PR but probably the output will not be that good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most CSS-in-JS
uses styleis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you could read it from mdn/browser-compat-data
as suggested here: #996
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attempt with Stylis #1480
"change-case": "^4.1.2", | ||
"css-tree": "^1.1.2", | ||
"fast-levenshtein": "^3.0.0", | ||
"json-stable-stringify": "^1.0.1", | ||
"mdn-data": "^2.0.14", | ||
"postcss": "^8.1.14", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also adds about 60kb
c7a2fbd
to
96daef5
Compare
Vendor prefixes are automatically added into the generated CSS.
96daef5
to
fa327ca
Compare
See #1480 |
@michalsanger So this branch can be deleted? 🙂 |
Vendor prefixes are automatically added into the generated CSS.