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

Classes are not 'added' with @nuxt/content #2005

Closed
MLoth opened this issue Dec 16, 2022 · 3 comments · Fixed by #1963
Closed

Classes are not 'added' with @nuxt/content #2005

MLoth opened this issue Dec 16, 2022 · 3 comments · Fixed by #1963

Comments

@MLoth
Copy link

MLoth commented Dec 16, 2022

The issue
When you add classes in HTML of an .md-file in a Nuxt project, the classes are not added.
Maybe these classes are not being scanned during the build?
E.g.:

---
title: 'Some content'
description: 'Demo article or whatever'
---

# Markdown

<div class="h-64 text-pink-600 bg-red-100">Test with some UnoCSS classes</div>

Those classes are not applied, except when you reuse a class you have elsewhere (in some .vue file).

Reproduce

  1. Create a Nuxt project.
  2. Add unocss.
  3. Add @nuxt/content
  4. Paste the example given above in the content folder.

Q: Is this a bug, is there a common workaround or am I doing something wrong?

@MLoth MLoth changed the title Classes are not 'added' when using @nuxt/content Classes are not 'added' with @nuxt/content Dec 16, 2022
@sibbng
Copy link
Member

sibbng commented Dec 16, 2022

Related #1947
Can be fixed by #1963

Q: Is this a bug, is there a common workaround or am I doing something wrong?

You can add these classes to safelist option.

@MLoth
Copy link
Author

MLoth commented Dec 17, 2022

My bad, I didn't look at the discussion, only in the issues.
I thought about using the safelist, but that's not really a scalable solution...

Closing this as a duplicate to #1947 and will check there later on. Thanks!

@MLoth MLoth closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2022
@sibbng
Copy link
Member

sibbng commented Dec 17, 2022

It's ok. Let's keep that open, so others can see it 😉

@sibbng sibbng reopened this Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants