For some reason I'm struggling with making Action Text (Trix editor) icons bar to load in production (Heroku). I'm building a relatively simple web app using Rails 6 & TailwindCSS. Action Text is fully functional both locally and in production, but while styles are loaded as expected on my local machine, I'm unable to make it work in production.
app/javascript/stylesheets/application.scss
@tailwind base;
@tailwind components;
@tailwind utilities;
@import 'trix/dist/trix.css';
@import "components/actiontext";
/*! purgecss start ignore */
@import "components/buttons";
@import "components/forms";
/*! purgecss end ignore */
app/javascript/packs/application.js
require("@rails/ujs").start()
require("turbolinks").start()
require("@rails/activestorage").start()
require("channels")
require("trix")
require("@rails/actiontext")
import "stylesheets/application"
import "controllers"
app/javascript/stylesheets/components/actiontext.scss
@import "trix/dist/trix.css";
// trix-toolbar {
// .trix-button {
// @apply bg-white border-0;
// }
// .trix-button-group {
// border: 0;
// }
// .trix-button--icon-bold {
// @apply rounded-tl rounded-bl;
// }
// .trix-button--icon-redo {
// @apply rounded-tr rounded-br;
// }
// }
// .trix-button--icon-attach,
// .trix-button-group-spacer,
// .trix-button--icon-decrease-nesting-level,
// .trix-button--icon-increase-nesting-level,
// .trix-button--icon-code {
// display: none;
// }
.trix-button-group--file-tools { display: none !important; }
.trix-content {
.attachment-gallery {
> action-text-attachment,
> .attachment {
flex: 1 0 33%;
padding: 0 0.5em;
max-width: 33%;
}
&.attachment-gallery--2,
&.attachment-gallery--4 {
> action-text-attachment,
> .attachment {
flex-basis: 50%;
max-width: 50%;
}
}
}
action-text-attachment {
.attachment {
padding: 0 !important;
max-width: 100% !important;
}
}
}
app/views/shared/_head.html.erb (relevant part)
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
UPDATE:
I have followed Elrik's advice and excluded Trix & actiontext.scss from PurgeCSS. Now it's better, but still something is off:

What am I missing here? Thanks in advance!

