Custom CSS

866 views
Skip to first unread message

Alberto Sánchez Molero

unread,
Mar 10, 2012, 8:07:23 AM3/10/12
to rails_admin
Hi, I want to customize the width of the text fields and I have read
the wiki page on theming and customization. I have been told to create
the files app/assets/stylesheets/rails_admin/custom/theming.css.scss
and app/assets/stylesheets/rails_admin/custom/variables.css.scss, and
then to add my SCSS here.

I added some classes there, but they don't show up in the final CSS
when <link href="/assets/rails_admin/imports.css?body=1" media="all"
rel="stylesheet" type="text/css" /> is called.

Instead, the original theming.css.scss and variables.css.scss from the
gem path are used.

Hernan

unread,
Mar 15, 2012, 8:18:50 AM3/15/12
to rails...@googlegroups.com
Hi,

could you resolve it? I am looking for a solution 2 days ago.
I tried putting the following code in my application_controller.rb, but this didn't work for me:

  before_filter :if => Proc.new{ |c| c.request.path =~ /admin/ } do 
    @head_stylesheet_paths = ['custom.css'] 
  end

I tested (without success) the custom.css file into:

app/assets/stylesheets/rails_admin/custom/
app/assets/stylesheets/rails_admin/
app/assets/stylesheets/

Thanks,
Hernan

Benoit Bénézech

unread,
Mar 15, 2012, 9:44:55 AM3/15/12
to rails...@googlegroups.com
It should be app/assets/stylesheets/rails_admin/custom/theming.css.scss

Normally, yours should override the dummy one from RailsAdmin and get picked by the asset pipeline. You may need to restart the server (not sure).

In any case, don't precompile assets in dev mode (use the pipeline and Rack::Cache).

Hernan Maguiña

unread,
Mar 15, 2012, 1:03:20 PM3/15/12
to rails...@googlegroups.com
Hi,

Thank you, actually that was my first try, i read it at https://github.com/sferik/rails_admin/wiki/Theming-and-customization, and i had too a app/assets/stylesheets/rails_admin/custom/theming.css.scss

But i forgot to re-compile my assest or just delete the content from my tmp/cache folder. Now it works fine!

Thanks again,
Hernan


--
You received this message because you are subscribed to the Google Groups "rails_admin" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rails_admin/-/NEckcN9SFC8J.
To post to this group, send email to rails...@googlegroups.com.
To unsubscribe from this group, send email to rails_admin...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rails_admin?hl=en.

Reply all
Reply to author
Forward
0 new messages