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

Allow custom CSS w/o having to install the Administrate assets #1256

Closed
colinrubbert opened this issue Dec 5, 2018 · 4 comments
Closed

Allow custom CSS w/o having to install the Administrate assets #1256

colinrubbert opened this issue Dec 5, 2018 · 4 comments

Comments

@colinrubbert
Copy link

This issue was referenced in #748

Administrate makes some decisions that force the user to either build entirely through the Administrate MVC, however, this isn't a great approach if you're just wanting to have an admin section of your app and not an admin dashboard for the entire application.

Adding custom CSS to the application requires installing the Administrate assets and adding the custom styles through the Administrate assets or importing custom Sass through the admin/application.scss file. This is not exactly the most user friendly approach to implementing CSS. It took me awhile to figure out why my CSS wasn't loading at all. I had to look at the actual application requests to identify what was happening.

My proposal would be to let go of some of the control that Administrate takes over the application. Opening up styles, js, views, etc to easily be modifiable if we need to. It's going to be difficult to get wide adoption if there isn't more readily available customization. Things like being able to add a Home, Sign Out or Top Navigation needs to be accessible and currently it's too much work, relatively speaking, to get those things working in the app. They should just be there.

My two cents

@c4lliope
Copy link
Contributor

@colinrubbert I think you're selling your advice too cheaply, at 2¢.

This is a really valuable sentiment - I think there's a lot of work that can be done along these lines.

How would you like to see custom CSS implemented? Let's start with the goal of adding "Top Navigation", so we can talk more concretely.

From http://administrate-prototype.herokuapp.com/customizing_page_views
I would start by suggesting rails generate administrate:views:layout,
and then editing the app/views/layouts/admin/application.html.erb file that it generates.
If the community is in favor of a top-bar by default, we can add a partial and new generator -
something our current rails generate administrate:views:navigation.

Of course, that doesn't get you CSS. It would be nice if Rails supported co-locating styles with view code, but I think that feature is still only in the front-end world.


As a side note, #1186 is starting to look at a default admin home page.


I'll leave this up to you to shape out

@pablobm
Copy link
Collaborator

pablobm commented Jan 30, 2020

I'm not sure that the CSS part is possible, due to the way Rails engines work. If someone has an idea, please let us know!

@pablobm pablobm closed this as completed Jan 30, 2020
@9mm
Copy link

9mm commented Apr 27, 2023

@pablobm how would i go about just adding some custom CSS to the admin area? The text areas are way, way too narrow.

@9mm
Copy link

9mm commented Apr 27, 2023

nevermind i just did generate views:layout

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

4 participants