Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The Outside In sidebar uses the frontend theme:
When you click on any of the links within the sidebar, you get taken to pages styled with the admin theme. It seems to me the sidebar should also be styled with the admin theme.
This is related to #2781577: Properly style outside-in off canvas tray, but a separate (simpler and less potentially contentious) suggestion. It could be an interim step as well.
Comments
Comment #2
xjmComment #3
tkoleary CreditAttribution: tkoleary at Acquia commented@xjm
When we build edit module we encountered this issue as well and discovered that it is not possible to use the admin theme unless the modal (in this case the off-canvas tray) was in an i-frame which is undesireable for many reasons. What we could do is copy styles from the Seven theme into the module.
I don't think that is a particularly good solution for a couple of reasons. One is because it's not DRY. Another is that it only makes sense for sites where the admin theme is Seven, and many sites will install another admin theme in which case they would get their admin theme styling on admin pages and Seven theme's styling elsewhere.
This has been a nagging problem for a long time and it's one that I think is outside the scope of this issue. The solution needs to be something like a module for "administrative stuff that gets displayed when the active theme is not the administrative theme" that did something like discover what the admin theme is then @import the CSS from that theme's CSS directory into a CSS file in the module directory, then that module could be a dependency for any "admin thing" you want to put on the front end, including outside in, quickedit, jquery modal, Panels IPE, etc. etc.
For the purposes of outside-in, I think we should create styling that simply resets whatever is being provided by the frontend theme to something as generic as possible.
Comment #4
xjmHuh, but it does use the frontend theme though?
Is this existing technical debt in the theme system?
Toolbar does have its own look/feel that is independent of either the frontend theme or the admin theme, so if using the admin theme is not an easy interim fix, then it's probably better to wontfix this in favor of just implementing the design from the spec. I have a feeling we will still run into issues with the frontend theme leaking though. How does Toolbar do it?
Comment #5
tedbowComment #6
tkoleary CreditAttribution: tkoleary at Acquia commented@xjm
Both toolbar and quickedit provide aggressive resets so that front end theme styles don't leak through, but each has it's own resets. If we were to find a way to programmatically bring in styles from the admin theme then it might make sense to have a single reset file that covers all 'admin things" that appear on the front end.
This could possibly be accomplished by adding a parent class to all of those things like .admin-tool or something. Then we could have a reset file that had:
Selectors with more specificity might still leak through, but at some point it becomes the responsibility of the front-end theme to be aware that it f-ed up the admin theme.
The more I think about this though the more I feel that these administrative things are something that should not live in the admin theme directory at all but have their own separate home that behaves more like a module or library than a theme. There are several reasons for this:
It should still be possible for this library to behave like a theme in that a site builder might disable and replace it, only they would use libraries to do this not themes.
All of the above leads towards the conclusion that perhaps this is a much bigger issue that needs it's own meta (there may indeed be one already, I recall Lewis Nyman doing a lot of research in this area) and not a child of outside-in.
In the near term we can continue developing styles for the tray in a consciously non-dry way by borrowing thing from toolbar and quickedit with an eye to eventual recombination in a more holistic solution.
Comment #7
tkoleary CreditAttribution: tkoleary at Acquia commentedLet's postpone discussion 'til out-side in is stable.
Comment #8
tkoleary CreditAttribution: tkoleary at Acquia commentedThis proposal is bigger than this issue. There are already several issues around moving *all* admin stuff on the front end into a separate library or theme. Moving settings tray styling should be dealt with as a part of that process, not in it's own issue.
Comment #9
tedbowChanging to new settings_tray.module component. @drpal thanks for script help!