How to include the Trix styles in Rails when using Propshaft and DartSass

98 Views Asked by At

I include action_text in application.js:

// application.js
import "trix"
import "@rails/actiontext"

I'm showing the editor using simple_form like this:

 <%= f.rich_text_area :body %>

But it shows as plain text buttons with no styles included at all.

The Guide says:

The trix stylesheet will be included together with Action Text styles in your application.css file.

But it isn't, probably because I have an application.scss file, not .css and I'm not using sprockets.

How do I import the trix/action_text editor styles into my sass or otherwise include it on the page when using propshaft and Sass?

1

There are 1 best solutions below

0
Will On

ok, worked it out (ie tried everything until I stumbled on the obvious answer).

// application.scss
@import "trix";