Document what can be done and must not be done with tailwind and native
After following up your readme, I installed the plugin without any problem (using step 1 to test).
Then what? Let's try some stuff!
Test color ? Not working. Background color ? Not working.
I finally got something change with border-4 on a button element, proving the library works.
The I saw your default config file: https://github.com/rigor789/nativescript-tailwind/blob/master/tailwind.js
A lot of things are simply deactivated.
Here is a reason? Conflicts with NativeScript? Things to not use because of design?
A bit more documentation about that would be very welcomed. :+1:
Anything that's not supported in NS, or doesn't make sense has been disabled. Other unsupported values are filtered out as they wouldn't do anything in ns.
Colors should definitely work though: bg-red-500 text-red-100 should yield some results.
We should mention this in the README so I'll keep this open until I get the chance to write some more docs!
Thanks for the great plugin!
I found bg-red-500 uses the background-color property which doesn't seem to work, I tested by duplicating the style block and changing background-color to background and I got the expected result of a solid background fill!
I am using nativescript-vue which may be causing issues but I doubt it.
Maybe in future, we could modify to use different CSS properties that work with nativescript? however, I understand this would be quite time consuming to produce!
PS. I installed using PostCSS plugin and I'm using a tailwind.config.js file to alter theme colors.
I'm very new to nativescript and mobile development in general. I may be doing something wrong resulting in these (bg-red-500 text-red-100) classes not working properly
@louis-morgan it should be working fine, background-color is supported by NativeScript. Mind sharing the project? Are # you sure you haven't enabled purging?
@rigor789 Thanks for the quick response!
I had an empty purge array in tailwind.config.js, after removing that and restarting tns run it still did not work so I deleted the whole tailwind.config.js and bg-red-500 worked!
This obviously stops me customizing colors however I think this will be something wrong with my tailwind.config.js and (more likely) my poor understanding of the tailwind config as a whole.
Here's what I originally had:
module.exports = {
theme: {
colors: {
red: '#f37061',
blue: '#110965',
},
extend: {},
},
variants: {},
plugins: [],
}
Apologies if this is because I incorrectly configured the tailwind config
@louis-morgan that's the issue! You are overriding the default color palette. See Tailwind docs: https://tailwindcss.com/docs/customizing-colors/#overriding-the-default-color-palette
What you actually need (I assume) is to extend it: https://tailwindcss.com/docs/customizing-colors/#extending-the-default-palette
Well, aren't I a newbie! Thanks for your help! Appreciate it! I'll give this a go