How to use SCSS @import with current jquery-ui-rails gem
jquery-ui-rails-5.0.5, sass-rails-5.0.3
jquery-ui-rails-5.0+ changed the naming convention for its assets. Instead of jquery.ui. (Whatever) it's now jquery-ui / (whatever). The style sheets are named (independently) .css. This causes the highly recommended SASS option @import to fail while the CSS query continues to run.
I am working on this problem this morning and I found an answer in SASS-RAILS that was said to work but didn't. It had to include both the main and the theme with the desired module like this:
@import 'jquery-ui/core';
@import 'jquery-ui/datepicker';
@import 'jquery-ui/theme';
I wanted to post the answer I opened here in case it helps.
source to share
This works if you include the file extension as well:
@import 'jquery-ui/core.css';
@import 'jquery-ui/datepicker.css';
@import 'jquery-ui/theme.css';
Update: I pushed this to Heroku and it didn't work there. After some debugging, I figured I needed to rename them to * .scss or * .scss.erb in the theme before Heroku can process them. I copied them into my assets to do this.
source to share