-
Notifications
You must be signed in to change notification settings - Fork 182
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
Support for passing options to LightningCSS #220
Comments
Sounds good! I have started thinking that Nue should support Lightning CSS natively, so it should be part of the dependencies. I think it's the best way to write CSS today. And having the ability to customize the supported features in the configuration would make sense, provided there are sane defaults. I think light-dark is a good default. Is there a way to make a solid configuration system without adding "browserslist" as a hard dependency? |
I'm not quite sure, how to do that. Also, my approach wasn't feature based, but browser variant/query specific... For example, if I have this
it creates this array containing all versions and browsers, that should be supported:
and
In conclusion, I'm not quite sure how to do it, but I'll try looking into it, when I find the time. We could also allow changing PS: Have you seen this discussion: #211, primarily this comments: #211 (comment), #211 (comment) |
targets
support
My intuition says that browserlist is too complex and I'd like to go with feature detection only without that dependency. Not sure if that is possible, but to just list the things we want without the granular details might result to simplest outcome. |
I'm going to go ahead and add Lightning as a hard dependency and depreciate any other option (Stylus, and my own proprietary pre-processor). On the dev branch soon. |
It would probably be best, to just pass a lightning css config object and merge the two. Just not completely sure, if that works properly with the yaml file, as one might need js imports from lightning css / other modules. Maybe similar to the POC marked config? |
targets
support
Interesting: oven-sh/bun#14167 Sadly would probably break node compatibility. Maybe doing something to lightningcss like bundling in node with esbuild is possible. PS: made a sample implementation in my fork, but still fails for some tests and there still seem to be some bugs in bun css, as I get bun to crash. |
I want to support all browsers, but use some modern CSS features like
light-dark()
, which is currently only stable in Firefox.This is a rule, that can get transpiled by lightningcss to be available in all browsers, if you set a target. E.g.:
browser_targets: '>= 0.25%, last 2 versions, Firefox ESR, not dead'
(I'm willing to implement that, as I already have a working draft, that I would just have to clean up. It would add an option to the config, whose name+structure would need discussion)
Edit: Relevant part:
nue/packages/nuekit/src/builder.js
Lines 133 to 135 in c1feaa8
The text was updated successfully, but these errors were encountered: