Sampat Badhe
Sampat Badhe

Reputation: 9075

How to override active admin CSS?

I am using Active Admin, is there a way to override CSS used by the active admin theme?

For eg:- I have to change css of submit button which is disabled to cursor: wait; and make it unclickable.

What's the best way to do this?

Upvotes: 4

Views: 9750

Answers (4)

bractr
bractr

Reputation: 1

I put my form classes in a container class to create a more specific reference. Like..

.form-container {
font-family: 'open-sans';
width: 420px;

  .text-field-class {
  input{border:none; border-bottom: 1px;}
  }

}

this is working so far... for the most part. Better than important. Though maybe using an ID would be the more appropriate way.

Upvotes: 0

absar mushtaq
absar mushtaq

Reputation: 43

It is easy to change the styles in Rails 4. Go to

app/assets/stylesheets/active_admin.css.scss

OR (depending upon where you have kept the file)

vendor/assets/stylesheets/active_admin.css.scss

and add styles in there.

Upvotes: 0

ksu
ksu

Reputation: 608

just make a new file

app/assets/stylesheets/active_admin.css.scss

and put your scss code there.

(Or just active_admin.css with css code)

Upvotes: 5

AlexB
AlexB

Reputation: 7416

You can override any CSS property by overriding the CSS class or IDs in you own stylesheet with !important attribute if you do not have any access to the original stylesheet

For example, use

.submit-button {
    color: white !important;
}

to change the color of the submit button text.

Upvotes: 2

Related Questions