Bug in Template CSS?
Can anyone add a non-gray border to anything in the template? In development I can but in production all borders are grey no mater what color is specified. Try it on this site by using the inspector and changing the HTML. I can't find element on here that you can make non-grey.
Chris Oliver
I did some digging in the source code - none of the 'border-green-700' type CSS styles other than gray are included in the deployed manifest files. Look in the .js and .css head files on this site - these do not exist here either.
Chris Oliver
- I think there is a bug in the system somewhere.
Local development works fine. Production breaks. I am finding more examples of this where the CSS on background colors also fail. Try applying 'bg-green-700' to any div on this page. Then try 'bg-gray-700'. Only gray works. Perhaps
ror_app_root/config/environments/production.rb
replace ror_app_root with whatever your app's root directory is, and the production.rb file is where you can configure your production configurations. I could be wrong (because I do not use hatchbox) but if you change line 29(default) from:
# Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false
change to:
# Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = true
it may fix the issue. It appears to be something with your assets and precompilation.
All the config settings in that general area (the assets portion of the production.rb file) will be where your development and production configurations differ.
All the config settings in that general area (the assets portion of the production.rb file) will be where your development and production configurations differ.
Comment Out the third line below(which is line 23 in the default production.rb config file), and try to deploy:
# Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
https://www.purgecss.com/
The template uses this to purge out unused CSS to make your site load faster. The issue is it seems to only leaving in the CSS styles that
Have a look in your root 'postcss.config.js' file.
I added a test style:
if (process.env.RAILS_ENV === "production" || process.env.RAILS_ENV === "staging") { // A whitelist of css classes to keep that might not be found in the app function collectWhitelist() { return ['font-serif', 'tab-active', 'transition', 'text-gray-400', 'border-green-700']; }
and ta-da! it works in production. Very frustrating but glad to see the light at the end of the tunnel.
As a work around for now I am disabling this completely. On my to do list is to figure out how to use this and not kill all my CSS.
I did not dig through to figure out where this was breaking. Some of the CSS in the views is being loaded and some not. I got the impression this processes your html and then compiles the bare minimum CSS you need to deploy. If that's the case it's broken because I had added many tailwind standard classes to my template app and after deploying those classes are not being added to the CSS.
Notifications
You’re not receiving notifications from this thread.