Skip to main content

After adding the activeadmin gem, my previous style changed, How can avoid this?

Gems / Libraries • Asked by Larry Qu

After adding the activeadmin gem, my previous style changed , How can avoid this?

Previous style is :

After adding the activeadmin gem, the style become this:

but if I comment the active_admin scss out, the admin page will have no style.
active_admin.scss

@import "active_admin/mixins";
@import "active_admin/base";

Make sure you're not requiring the active admin css file in your application.css on accident (probably with a require_tree). Their CSS is made to be compiled separately into another file out of the box and so you don't want to include their CSS with yours. That's probably happening with a bad require or import in your application.css at the top.


yes, solved! Thank you !
After I manually require scss files, no longer use require_tree it works fine.

 *= require_self
 * require_tree . // not used
 *
 *= require addresses.scss
 *= require carts.scss
 *= require checkout.scss
 *= require full-width-pics.scss
 *= require order_items.scss
 *= require orders.scss
 *= require products.scss
 *= require scaffolds.scss
 *= require services.scss
 *= require startup.scss
 */

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 22,346+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.