Problem/Motivation

If you enable Seven as a main theme, it is visually broken on non-admin pages (see screenshot).

Why would you do that? The typical example is Headless Drupal, or any situation where the goal of the installation is not to generate a website (collaboration tools, etc). You want to use Seven for all the nice UI stuff it provides out of the box, and since you don't actually have a "frontend" theme you want that same look for the various non-admin pages (login form, user profile, etc).

What currently happens if you enable Seven as the main theme is that non-admin pages don't load system.admin.css and what is immediately visible is that the page has no margin so form fields stick to the edge of the page.

The current workaround is to either alter all non-admin pages to make them "admin pages", or to create a Seven subtheme that includes a copy of system.admin.css. Both solutions are quite ugly, and it would be nice if you could make Drupal "backend-only" without needing to write code.

Proposed resolution

Add the system/admin library as a dependancy of the Seven theme

Remaining tasks

None

User interface changes

The Seven theme maintains layout on frontend pages

API changes

None

Before:

After:

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because Seven's layout is broken on the frontend
Issue priority Normal because using Seven on the frontend is not a common usecase
Unfrozen changes Unfrozen because it only changes CSS
Prioritized changes The main goal of this issue is usability

Comments

lewisnyman’s picture

Issue tags: +frontend, +CSS, +Novice

I guess we should add the system/admin library as a dependancy to seven.libraries.yml

floretan’s picture

Yes, that makes sense. I didn't think about the fact that system.admin.css is already always loaded with Seven if it's used as an admin theme, so there's no drawback of explicitly mentioning it as a dependency.

martin mayer’s picture

Assigned: Unassigned » martin mayer
martin mayer’s picture

I inserted the dependency and the non admin pages look ok then.

martin mayer’s picture

Status: Active » Needs review
lewisnyman’s picture

Status: Needs review » Reviewed & tested by the community

I manually tested this this patch and it works as expected. I also quickly looked around the admin interface for anything that would be broken and it looks the same.

lewisnyman’s picture

Issue summary: View changes
lewisnyman’s picture

Issue summary: View changes
lewisnyman’s picture

Issue summary: View changes
StatusFileSize
new206.01 KB
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 34e7824 and pushed to 8.0.x. Thanks!

  • alexpott committed 34e7824 on 8.0.x
    Issue #2473343 by floretan, Martin Mayer, LewisNyman: Seven Theme is...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.