administrate: Undefined variable: "$bold-font-weight".

Hi all

I’m using the gem directly from Github and if I run rails generate administrate:assets:stylesheets. I get the following error Undefined variable: "$bold-font-weight". when trying to load anything in /admin

I also noticed that some of the generators seem to produce different code from the default code. For example ‘rails generate administrate:views:new Client’ the forms all look broken.

Any ideas how to resolve this?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 47 (11 by maintainers)

Most upvoted comments

@nickcharlton what’s the solution?

I was able to solve the issue by creating an app/assets/stylesheets/public directory and moving everything that used to live in app/assets/stylesheets (pre-Administrate) to app/assets/stylesheets/public. Then I changed require_tree . in app/assets/stylesheets/application.css to require_tree ./public.

You could of course call the public directory anything you want.

This is not very helpful solving the actual problem but for those like me who need to make progress, I worked around the issue by importing the variables at the top of my application.scss

@import 'administrate/library/variables';

Note that this required me to copy-paste two values from the included Bourbon library in app/assets/stylesheets/administrate/library/_variables.scss

$modular-scale-ratio: 1.2;

$base-timing: cubic-bezier(0.215,  0.610, 0.355, 1.000);

@drinks Does it work if you remove the require_tree .?

Is this still an active issue? If it is, v0.7.0 was just released with lots of changes to the Sass that perhaps fixes it?

remove *= require_tree from the main application.css helped me loads other stylesheet and therefore solved the problems