Comments (21)
will debug this tomorrow
from svelte-windicss-preprocess.
@prab-it @munxar I am not happy with that, but I would like to ask you guys test your cases with the new examples for rollup & snowpack. (I will add svelteKit
later, however we might not support that fully until it is released). I think that the old examples where outdated, and this might have led to some issues. I am more than happy to fix this, however first we need to find out if this is happening caused by outdated example configuration or if this is still happening with the new examples. In parallel, I will be making more debugging on my side too.
Thanks, you, guys!
https://github.com/windicss/svelte-windicss-preprocess/tree/main/example/rollup
https://github.com/windicss/svelte-windicss-preprocess/tree/main/example/snowpack
from svelte-windicss-preprocess.
ok. I am working on examples for Sapper
and svelteKit
, just need some more time. Please wait until I finish them, and then look if the setup is close to yours & what is different. I really need to find out if this issue is setup or bundler specific, because I do not see any issue in CSS parsing right now. So it has to be a combination of two!
from svelte-windicss-preprocess.
@prab-it globalUtility: false
works for me in your project, as I concluded earlier this might also be the correct way to set with bundlers splitting files into multiple css
from svelte-windicss-preprocess.
@alexanderniebuhr this is my sapper-ts-windicss
repo:
sapper-ts-windicss.zip
from svelte-windicss-preprocess.
@prab-it dynamic classes will be fixed in a future release, down the road 2-4 releases or so. So, no fast fix here, just be patient, and reposition some classes, subscribe #35
I will have a look at sapper later but will be same solution. Either global and props, or scoped and no props
from svelte-windicss-preprocess.
@alexanderniebuhr the rollup example in main branch works for me, no issues so far.
from svelte-windicss-preprocess.
@alexanderniebuhr found an issue with rollup
with bundle
option, for more info download attached rollup-windicss.zip
and open App.svelte
.
rollup-windicss.zip
from svelte-windicss-preprocess.
will check later
from svelte-windicss-preprocess.
@alexanderniebuhr ok the main issue is related to live changes. Restart the dev
server fix this issue.
How to reproduce the issue:
1 - $ npm run i
2 - $ npm run dev
3 - add one more Input
in src/App.svelte
<Input type="number"></Input>
from svelte-windicss-preprocess.
@alexanderniebuhr ok, I tested on both, Sapper
and SvelteKit
.
Sapper + Rollup:
The bundle.css
made with rollup-plugin-css-only
fix the issue.
SvelteKit + Snowpack:
Works partially with npm run dev
and it doesn't work with npm run build && npm run start
.
from svelte-windicss-preprocess.
you used the outdated examples?
from svelte-windicss-preprocess.
@alexanderniebuhr I used the latest examples.
https://github.com/windicss/svelte-windicss-preprocess/tree/main/example/rollup
https://github.com/windicss/svelte-windicss-preprocess/tree/main/example/snowpack
from svelte-windicss-preprocess.
and you added Sapper
and svelteKit
yourself?
from svelte-windicss-preprocess.
@alexanderniebuhr yes.
from svelte-windicss-preprocess.
@alexanderniebuhr ok, thanks BTW!
Try my sveltekit-windicss
repo with bug:
sveltekit-windicss.zip
from svelte-windicss-preprocess.
@alexanderniebuhr you are right, globalUtility: false
fix the issue! 👍
I don't know what was the problem last time with globalUtility: false
, but it works!
Is it possible achieve something like this with Sapper + Rollup
, I mean without rollup-plugin-css-only
?
Thanks again for your support!
from svelte-windicss-preprocess.
Do not have any Rollup Setup right now, can you share yours too. Then I can have a look
from svelte-windicss-preprocess.
@alexanderniebuhr wait a second, I found what was the problem, if I set globalUtility: false
, now I can't pass class
as prop
to my Input
component.
ex. try to set border-8
, it doesn't work...
src/routes/index.svelte:
<script>
import Input from '$components/Input.svelte';
</script>
<form action="#">
<Input type="text" placeholder="input 1" class="border-8" />
</form>
from svelte-windicss-preprocess.
Again globalUtility: false
is the solution and then https://svelte.dev/repl/88c699452f7644afa71f101a5a1b06d2?version=3.24.0 or https://svelte.dev/repl/299bec14c8154ad89eb53f3d18ba2a37?version=3.24.0 if you need to parse classes as props. Your use case is not support by svelte. Svelte is all about scoped styles. So, the styles need to be defined in the component or in a style tag with (both needs unreleased svelte-windicss-preprocessor and svelte-preprocessor)
<style global>
...
</style>
<style>
:global(h1) {
...
}
</style>
from svelte-windicss-preprocess.
actually it works for me, even with globalUtility: true
, cannot reproduce ur issue
from svelte-windicss-preprocess.
Related Issues (20)
- :global() rules not resolved correctly in Svelte HOT 1
- 4.1.0-beta2: selectors produce `unused CSS selector` error when commented out. HOT 2
- 4.1.0-beta2: dynamically added classes get lost HOT 3
- Duplicate `windi:inject` attribute error while working with svelte kit component library HOT 3
- using svelte.kit in `<style></style>` section, on selectors of HTML tags, is not working HOT 4
- HMR issue while reloading windi.config.ts changes HOT 11
- [EXPERIMENTAL] pure css icons
- Rollup unhappy with WindiCSS config HOT 5
- darkmode config does not work as configured HOT 2
- css keyframes are purged in 4.1 HOT 2
- v.4.2.3 if no <style> tag is in the ".svelte" file, inline classes do not work. HOT 5
- Any component that has at least one element with a class results in a preprocessor error HOT 3
- findIndex break windi preprocessor from point of call
- class="$$props.class" is not working, but would be good to have a function to solve this: HOT 6
- Classes of typescript components don't get processed with svelte kit HOT 6
- Not working for hello world HOT 2
- RTL styles stripped out by Svelte compiler if `dir="rtl"` is outside of component (always) HOT 2
- Can't use the new color in "svelte-windicss-preprocess" HOT 1
- Dark variant doesn't work with @apply directive HOT 5
- @iconify/json included by default, adding ~40mb to the download
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-windicss-preprocess.