Closed rluiten closed 4 years ago
Thanks for the bug report.
I've made a reduced test case here. Still looking into why and where those errors are thrown.
Glad its of interest, it definitely raised an eyebrow when I saw the errors :).
@ben-rogerson May I know do you have idea about this issue now? Although it's just warning messages but still quite annoying.
Haven't worked this out yet, I'll take a better look into it after the next Twin version is out.
This should be working now, but you might need to escape some of those keys with tailwinds e
function. You can also use addComponents
in plugins since v1.4.0.
Would you be able to verify the stacks are working in 1.4.0?
I'll see about tinkering with it again in the next week or so.
If I might ask what is there a short form outline of what the problem was?
Cheers!
I'm now camelizing the keys in userPlugins so they can't trigger the kebab-case rule 👍
@ben-rogerson I'm not sure if you pushed the fix up already but it looks like 'box-content' is triggering the kebab error as well.
Great find there, box-border
and box-content
will both throw that error - I'll patch that up
There doesn't seem to be any other kebab-cased properties.
I've just pushed a patch for this in 1.4.1 Codepen demo without console errors I've had a good look around for more properties with the same issue and we're looking clear!
I created an example sandbox forked from one I stumbled on that you created. https://codesandbox.io/s/cra-tailwind-emotion-starter-4wkeh
My fork adds a plugin to tailwind.config.js then replaces the styling in App.tsx with the new "stack" class that the plugin implements. When loading I see 4 errors reported in the console when you load it. Everything appears to work correctly, just the errors come out and I thought they may indicate a problem internally somewhere.
I am pretty sure I have the styles correct so maybe twin.macro has converted them to real styles before it reaches emotion somewhere ?
So far liking twin.macro, interesting stuff.
This is what my tailwind.config.sj file looks like with the plugin added. The plugin adds stack classes as created and documented by https://every-layout.dev/layouts/stack/
This is the updated App in App.js
These are the errors I see in console.