Can I get a CSS clearfix for admin-content DIV ?
AI-generated summary
A discussion about CSS in the admin-content section of a forum led to concerns about custom styles being applied in the admin interface, causing issues. DeanMarkTaylor requested a CSS clearfix for the admin-content DIV. riking pointed out that custom CSS is usually removed in admin pages, unless applied in the </head> section. The discussion revealed that custom styles can cause problems, such as compilation errors or incorrect styling, and that the current behavior of loading the admin interface without customizations when accessed directly is inconsistent.
elberet and riking argued that custom styles should be allowed in the admin interface, but with a way to recover from potential errors. zogstrip mentioned that the current behavior is generating support requests. A fix was proposed by zogstrip, who pushed a commit to automagically disable custom stylesheets when entering the /admin section and enable them back when leaving.
Aren’t CSS styles removed when you view the admin pages? Unless you apply the CSS in the </head> section I suppose. Is that how you got that bright blue background?
no, but I discussed this with @eviltrout before, we want to remove them unconditionally when you enter admin.
Why? I quite like having my admin interface match the main forum’s design.
You need, at minimum, an obvious way to recover if a CSS compilation error or CSS bonehead error occurs though.
(Boneheaded: body { display: none; })
Sure, but that’s why the admin interface is loaded sans customizations when it’s entered directly (i.e. browse to /admin in an empty tab) instead of via an Ember transition, no?
Yeah but that behavior isn’t consistent and is generating support requests.
This request does stem from admin having an issue directly because of “user styles” being applied in admin…
… When visiting admin from an initial normal page load which happens frequently.
For these screenshots I simply added the blue background to the <HTML> tag in Chrome Dev tools after loading admin directly with a dark color only theme (no CSS).
I just pushed a fix that will automagically disable custom stylesheets when you’re entering the /admin section and enable them back when you’re leaving it ![]()
https://github.com/discourse/discourse/commit/7e1651a36e9d47f9a987b37481ef05057f8b497c

