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

Background gradients not supported #188

Open
MrSnoozles opened this issue May 9, 2023 · 3 comments
Open

Background gradients not supported #188

MrSnoozles opened this issue May 9, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@MrSnoozles
Copy link

MrSnoozles commented May 9, 2023

I'm trying to use tailwinds background gradients but they do not seem to be supported.

Documentation:
https://tailwindcss.com/docs/background-image#linear-gradients

``

Example:
Using the CSS classes bg-gradient-to-r from-cyan-400 to-blue-500 should create a gradient, instead no background is applied.
https://stackblitz.com/edit/nativescript-stackblitz-templates-nsvck4?file=app%2Fmain-page.xml&title=NativeScript%20Starter%20TypeScript

@MrSnoozles MrSnoozles changed the title Background gradients not working Background gradients not supported May 9, 2023
@rigor789 rigor789 added the enhancement New feature or request label May 10, 2023
@rigor789
Copy link
Member

I believe this is because core does not support css variables in gradients yet.

@MrSnoozles
Copy link
Author

Would that be difficult to support in core?

@rigor789
Copy link
Member

Not sure, probably not too difficult, but I don't know without diving into it...

Your best bet until it is supported would be to define the gradients with regular css (can even be via tailwind's inline definitions), or in the tailwind config as custom background values: https://tailwindcss.com/docs/background-image#customizing-your-theme

module.exports = {
  theme: {
    extend: {
+     backgroundImage: {
+       'gradient-red-to-blue': "linear-gradient(to right, red, blue)",
+     }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants