Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@supports syntax not supported by LibSass #16

Open
otagi opened this issue Oct 25, 2023 · 5 comments · May be fixed by #17
Open

@supports syntax not supported by LibSass #16

otagi opened this issue Oct 25, 2023 · 5 comments · May be fixed by #17

Comments

@otagi
Copy link

otagi commented Oct 25, 2023

Problem

With the updates to Fomantic UI 2.9.0–2.9.3, a SassC::SyntaxError is raised when building the Fomantic UI CSS:

SassC::SyntaxError in <controller action>

Showing <view path> where line #<line> raised:

Error: Invalid CSS after "@supports ": expected @supports condition (e.g. (display: flexbox)), was "selector(:has(.f)) "
        on line 541:10 of ../../../.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fomantic-ui-sass-2.9.3/app/assets/stylesheets/semantic-ui/elements/_input.scss
        from line 9:1 of ../../../.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fomantic-ui-sass-2.9.3/app/assets/stylesheets/semantic-ui/elements/_all.scss
        from line 2:1 of ../../../.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fomantic-ui-sass-2.9.3/app/assets/stylesheets/semantic-ui.scss
        from line 18:1 of app/assets/stylesheets/application.css.scss
>> @supports selector(:has(.f)) {
   ---------^

Official Sass fix

sass/sass#2780 deals with the extended @supports syntax, and references a fix for DartSass.

However, that issue explicitly says that LibSass will not be fixed because it is deprecated.

Potential solutions

  • Strip unsupported @supports syntax from the code, or
  • Change the gem dependencies from LibSass to DartSass.
@shanecav84 shanecav84 linked a pull request Nov 22, 2023 that will close this issue
@shanecav84
Copy link
Collaborator

@otagi Thanks for the issue, and sorry for the late response. Can you please test the fix I've implemented in #17 ?

@otagi
Copy link
Author

otagi commented Nov 27, 2023

@shanecav84 No worries, and thank you for #17!

I’m currently busy with an unrelated feature on our app, but will test your update with our Dartsass branch ASAP.

@otagi
Copy link
Author

otagi commented Nov 27, 2023

@shanecav84 I created a standard test app with rails new dartsass-test --css=sass.

https://github.com/otagi/dartsass-test

When launching Puma with bind/dev, this compile error happens:

Error: Can’t find stylesheet to import.
    || 2 │ @import "semantic-ui";
    |   │         ^^^^^^^^^^^^^
    ||   app/assets/stylesheets/application.scss 2:9  root stylesheet

@shanecav84
Copy link
Collaborator

I'm still looking into this. The cause of that error is due to Rails use of cssbundling-rails for managing CSS assets. This no longer relies on Sprockets which is what this gem relies on. I'm thinking that the best solution for those using a non-Sprockets bundling system is to just swap this gem for Fomantic-UI itself https://github.com/fomantic/Fomantic-UI and set up your bundling pipeline to use that instead.

I'm still investigating. That isn't the final word.

@hklemp
Copy link

hklemp commented Feb 29, 2024

Hi, any updates on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants