0

I have an @import rule within a CSS file in my asset path:

// /app/assets/product/ow.css.scss
@import 'foo.css.scss';

And I put foo.css.scss inside the same folder. Rails is automatically pulling in foo.css since it's in the asset path, and then it's duplicating the request to pull in foo.css because of the import.

What's the correct way to handle CSS @import rules within the Rails framework?

1 Answer 1

1

Check your app/assets/stylesheets/application.css and remove Sprockets directives. My guess is *= require_tree . is causing your @import to be pulled twice. Check out the Rails Asset Pipeline documentation for more information.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.