Comments (6)
Hmm, yeah, that's a good issue. Probably need some way for the compressor to only apply to certain files. I'll have a look at that. And also, we need to document how to include the engine views to consider those – because that might well be relevant for Tailwind too, if you use that in your engines.
from tailwindcss-rails.
👋, haven't used Administrate but I'm guessing it's a Rails::Engine, so those views aren't considered, so the compressor would need to be told to look at those view files via something like:
config.assets.css_compressor = Tailwindcss::Compressor.new(files_with_class_names: Rails.root.glob("some/engine/root/**/*.*"))
(I don't know where to find the engine root though, depends on the gem install.)
But seems tailwindcss-rails should be Rails::Engine aware and the default app/views
and app/helpers
directories shouldn't be tied to just Rails.root
necessarily. Can't remember how Rails::Engines automatically add their views to the main Rails app, but when we find that, I think we can reuse that to siphon extra locations to look.
from tailwindcss-rails.
Yeah, I think it's a good solution to make et engine aware. Just as a side note: There is stuff in the administrate.css file after purge because I have generated some of the Administrate views in the app/views folder.
I will go hunting for the path to the Administrate views :)
from tailwindcss-rails.
We've added Tailwind to our Rails engine (without webpacker) by compiling a custom build using npx that gets imported by Sprockets. It'd be great if instead of using npx
to purge unnecessary classes, we could use this Purger to target our Tailwind build specifically (and skip the main app's stylesheets). I believe (as discussed in #1) it's better to do this in a separate gem though.
from tailwindcss-rails.
Hmm, yeah, that's a good issue. Probably need some way for the compressor to only apply to certain files. I'll have a look at that. And also, we need to document how to include the engine views to consider those – because that might well be relevant for Tailwind too, if you use that in your engines.
I think a good start would be to have an option to only purge Tailwind as it's already a separate file, which would make it less intrusive.
I am also a big fan of a general purger gem.
from tailwindcss-rails.
The fix works great, thanks 🥰
from tailwindcss-rails.
Related Issues (20)
- Remove Inter font assets from inclusion in downstream projects HOT 6
- Support @config directive and multiple *.tailwind.css files HOT 1
- use scaffold generate password class is nil HOT 2
- `rails tailwindcss:build` causes Segmentation fault for Ruby 3.3.0 on aarch64-linux HOT 3
- tailwindcss:watch terminates with exception HOT 10
- uninitialized constant Tailwindcss (NameError) when launching puma HOT 16
- Watcher not working in Docker even with `tty:true` HOT 2
- How do I get the color palette from the tailwind docs to work? HOT 1
- Allow to choose between Procfile.dev or Puma plugin
- Classes not loaded while building
- TailwindCSS does not support react-on-rails with scss HOT 1
- Run bin/dev, but it failed to install foreman HOT 6
- Not working on x86 architecture
- Rails underscore escaping issues HOT 2
- Tailwind scaffold template is out of sync with rails/rails ERB scaffold template HOT 2
- May be time to remove @tailwindcss/aspect-ratio HOT 4
- Debugger hangs when I use the watcher as plugin! HOT 2
- bin/dev doesn't work for me. HOT 3
- Automate gem build and deployment with github actions HOT 2
- Investigate failing CI build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tailwindcss-rails.