tablecheck / dartsass-sprockets

Integrate Dart Sass with Sprockets (Ruby on Rails asset pipeline)
MIT License
35 stars 5 forks source link

asset-path in imported CSS files are not handled properly #8

Closed SebouChu closed 1 year ago

SebouChu commented 1 year ago

Hello! I'm currently working on using Dart Sass on my present and future Rails projects.

First, thanks a lot for the work on this gem to allow us to use Dart Sass with Sprockets. Unfortunately, it seems that there is a breaking change when moving from sassc-rails.

I'm using Summernote as a WYSIWYG editor, using the summernote-rails gem to handle fonts etc. But it looks like asset-path are not handled properly and to make it work, I had to rename the summernote style files from .css to .scss. I had no problem like this with sassc-rails.

I created a Rails app which allows me to send you feedback and report any bug I encounter. A detailed issue about this is available here : https://github.com/SebouChu/dartsass-sprockets-app/issues/1

johnnyshields commented 1 year ago

@SebouChu if I am reading correctly, it seems that dartsass-sprockets requires .scss to do SASS transformations, while .css is left used verbatim without SASS processing.

To me, this is a feature, not a bug. I would expect CSS to be unprocessed, while SCSS is processed. You will simply have to rename your files when migrating to use this library. I will add a note in the readme about this, and will close this ticket.

SebouChu commented 1 year ago

@johnnyshields The thing is, the file is actually CSS code, it's more about the fact that having css files with Sprockets helpers inside are broken and I was forced to change the extension to SCSS so that the file goes through Sprockets without any issue (no sass helpers)