1

I'm writing a Rails gem for my app. In this gem I have a CSS file. And everything works fine. But I want to be able to overload this file in my Rails app. Like this, my App will use the custom version of my CSS file.

Is it possible ?

Thank you in advance!

Mathieu Mahé
  • 2,647
  • 3
  • 35
  • 50

3 Answers3

1

OK, I found it.

I created a file with the same name in my App, but it also need to be located in a directory with the exact same path.

In my case, I was trying to overload the file in my gem located vendor/assets/stylesheets with a file in app/assets/stylesheets

Mathieu Mahé
  • 2,647
  • 3
  • 35
  • 50
0

You could also do a configuration option if the convention is too complex:

MyGem.configure do |config|
  config.stylesheet = 'app/stylesheets/my_style.css'
end
Kyle
  • 1,278
  • 6
  • 11
0

You can go with @import so that you are including stylesheets into other

Is it possible to include one CSS file in another?

Community
  • 1
  • 1
Thillai Narayanan
  • 4,766
  • 5
  • 32
  • 39