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

Adding mdsvex to svelte-scoped example #1936

Closed
willpuckett opened this issue Nov 30, 2022 · 3 comments · Fixed by #2035
Closed

Adding mdsvex to svelte-scoped example #1936

willpuckett opened this issue Nov 30, 2022 · 3 comments · Fixed by #2035
Labels

Comments

@willpuckett
Copy link

Running npx svelte-add@latest mdsvex in the svelte-scoped example project transforms markdown to html, but Unocss doesn't process the files, regardless of whether they have a .svelte.md, .md, or .svx extension.

Is there an additional setting that needs to be added to either vite.config.js, svelte.config.js, or mdsvex.config.js?

@willpuckett
Copy link
Author

willpuckett commented Nov 30, 2022

When I add ".svelte" to the mdsvex extensions list in mdsvex.config.js, the markdown is processed and the styles render, but it's obviously less than ideal since it means all the .svelte files are being processed as markdown....

@henrikvilhelmberglund
Copy link
Contributor

Same issue here, component styles work fine but the MDsveX layout/element styles are not being applied.

I don't have a stackblitz repo but I have a normal smallish repo if that works: https://github.com/henrikvilhelmberglund/Tutorials/tree/unocss (unocss branch)

@sibbng
Copy link
Member

sibbng commented Dec 30, 2022

You can add .svx extension in include option:

    UnoCSS({
      mode: 'svelte-scoped',
      include: [/\.svelte$/, /\.svx$/],

In my opinion, we should add svx to default list. PRs welcome!

Related code: https://github.com/unocss/unocss/blob/b19f5955112988b7a0f4916fc3273d68e69d159c/packages/vite/src/modes/svelte-scoped/index.ts

@sibbng sibbng added good first issue Good for newcomers pr welcome labels Dec 30, 2022
sibbng pushed a commit that referenced this issue Jan 1, 2023
…2035)

* feat: add mdsvex extensions to SvelteScopedPlugin filters

* fix: add missing (?) extensions here as well
praburangki pushed a commit to praburangki/unocss that referenced this issue Jan 12, 2023
…1936 (unocss#2035)

* feat: add mdsvex extensions to SvelteScopedPlugin filters

* fix: add missing (?) extensions here as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants