Petran
Petran

Reputation: 8047

How can I change css on rails activeadmin?

I have found a couple of similar questions but not a clear answer. I have install active admin and trying to change the css I read on the active_admin.css.scss

// To view the variables that Active Admin provides, take a look at // app/assets/stylesheets/active_admin/mixins/_variables.css.scss in the // Active Admin source.

I can't find the above file stylesheets/active_admin what am I missing ?

Upvotes: 4

Views: 1696

Answers (2)

Dave Newton
Dave Newton

Reputation: 160181

Are you looking in the gem directory, e.g.,

$ cd `bundle show activeadmin`

Running find here shows (just a partial listing):

➜  activeadmin-0.6.0  find . -name "*.scss"
./app/assets/stylesheets/active_admin/_base.css.scss
./app/assets/stylesheets/active_admin/_forms.css.scss
./app/assets/stylesheets/active_admin/_header.css.scss
./app/assets/stylesheets/active_admin/_mixins.css.scss
./app/assets/stylesheets/active_admin/_typography.css.scss
... etc ...
./app/assets/stylesheets/active_admin/mixins/_typography.scss
./app/assets/stylesheets/active_admin/mixins/_utilities.scss
./app/assets/stylesheets/active_admin/mixins/_variables.css.scss
... etc ...

Those are the styles you can override.

Then however you're loading your CSS, for example:

➜  cat app/assets/stylesheets/active_admin.css.scss
@import 'active_admin_custom';
@import 'bootstrap_and_overrides';

Throw your overrides/customizations in there.

Upvotes: 4

NM Pennypacker
NM Pennypacker

Reputation: 6942

I'd add anything you need use as an override to app/assets/stylesheets/active_admin/base.css.scss

Upvotes: 1

Related Questions