Background imports from tailwind config file doesn't work with vuejs
See original GitHub issueDescribe the problem:
Importing background images in tailiwind.config.js like
backgroundImage: (theme) => ({
'down-arrow': "url('/assets/down-arrow.svg')",
}),
is not working when the class bg-down-arrow is used The CSS in dev tools is
.bg-down-arrow {
background-image: url('/assets/down-arrow.svg');
}
The CSS when used a class in css is like
.bg-down-arrow {
background: url(/img/down-arrow.1467c7af.svg);
}
This is probably not a problem with Tailwind but there should be a way to handle this scenario for vuejs
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
tailwind styles dont apply in vue js project - Stack Overflow
In App. vue i try to use an div with class "bg-red", but no red background in output. These are my project files....
Read more >Using with Preprocessors - Tailwind CSS
A guide to using Tailwind with common CSS preprocessors like Sass, Less, and Stylus. ... top of a file. Won't work, `@import` statements...
Read more >Getting Started with Tailwind in Vue - This Dot Labs
Configure Tailwind and PostCSS; Import a CSS file that includes the Tailwind classes to your application. If you are using a custom setup...
Read more >Using Tailwind with Vue | Jerrie Pelser's Blog
A look at using the Tailwind CSS framework in Vue applications, allowing you to rapidly build custom user interfaces.
Read more >How to Configure your Vue js app to use Tailwind CSS - Medium
Then proceed to configure Postcss to process tailwind, Do that by adding the following code to your postcss.config.js file Navigate to src/assets/cssand ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey! Yeah unfortunately there’s no way to know the final URL for images within the Tailwind config if those images are being handled by another build tool and output to locations with hashes in the name and stuff.
No plans to do any work on this so going to close. Recommendation would be to configure your build tooling in such a way that you have deterministic image paths that you can use in your config file.
This is really cool @CJGjr !