Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom theme overrides not working on beta releases #3466

Closed
codealchemy opened this issue Feb 8, 2022 · 2 comments
Closed

Custom theme overrides not working on beta releases #3466

codealchemy opened this issue Feb 8, 2022 · 2 comments

Comments

@codealchemy
Copy link
Contributor

Describe the bug

When updating an existing app (using Rails 6 / Sprockets / asset pipeline), to 3.0.0.beta2 - custom theme overrides (following theming docs, which worked on 2.x.x releases) are not being picked up.

Specifically, anything defined in a projects app/assets/stylesheets/rails_admin/custom/theming.scss does not take precedence over RailsAdmin defaults (seems to be a load order issue for imports) .

Unsure if this applies to apps not using sprockets.

This can be reproduced on the dummy_app for the current master (see below)

Reproduction steps

Repro using the dummy_app in RailsAdmin -> codealchemy@1c8886f

Expected behavior

Existing theme overrides will continue to work (between 2.x.x and 3.x.x releases using the asset pipeline) as described in the Wiki.

Additional context

sassc-rails - 2.1.2
sassc - 2.4.0
sprockets - 4.0.2
rails - 6.1.3.1 (also seen on 6.0 project)
rails_admin - 3.x beta releases

@mshibuya
Copy link
Member

This was caused because when sassc tries to resolve imports, files available by relative path take precedence over files in asset_paths.
In #3414 RailsAdmin CSS was moved to app/assets/stylesheet/rails_admin.scss, so @import "rails_admin/custom/theming"; picked app/assets/stylesheet/rails_admin/custom/theming.scss, which was directly accessible by the relative path.

Moving the CSS to app/assets/stylesheet/rails_admin/application.scss solved the issue.

@codealchemy
Copy link
Contributor Author

Thanks!

mshibuya added a commit that referenced this issue Feb 27, 2022
While taking care of #3466 by moving custom stylesheets under vendor/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants