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

Handling of kebab-cased styles #216

Open
edwardhorsford opened this issue Jan 9, 2024 · 2 comments
Open

Handling of kebab-cased styles #216

edwardhorsford opened this issue Jan 9, 2024 · 2 comments

Comments

@edwardhorsford
Copy link

edwardhorsford commented Jan 9, 2024

Since installing this plugin I've had an error message in my terminal:

`container` unknown or invalid utility

I've now worked out this is coming from me using kebab-cased class names in my template. The class was text-container. If I swap it to being camel-cased, the error goes away. Other kebab cased classes on the templates don't seem to be causing issues interestingly.

The only similar mention of this I could find was on Satori, where it sounds like unrecognised options being passed. If I understand how this plugin works correctly, the styles from the template get inlined with each element before passing to Satori - I wonder if something is going slightly wrong with kebab-cased styles.

@edwardhorsford edwardhorsford changed the title Handling of camel-cased styles Handling of kebab-cased styles Jan 9, 2024
@KiwiKilian
Copy link
Owner

For inlining and transformation of HTML to the satori syntax satori-html is used. The latter tries to detect Tailwind classes, see https://github.com/natemoo-re/satori-html/blob/7bfe3cd1379d2b146324175bb63ddaa5bc46432b/packages/satori-html/src/index.ts#L23. So using such Tailwind prefix might end up in such warnings, worst case one could use a Tailwind class by accident. I'll have a look if the Tailwind class transformation can be disabled.

@edwardhorsford
Copy link
Author

@KiwiKilian thanks for looking at this.

Note I don't use tailwind - my classes are just regular BEM / Kebab cased.

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

No branches or pull requests

2 participants