Problem/Motivation
See discussion in: #2195695: Admin UIs on the front-end are difficult to theme
The toolbar is an administrative UI component that appears on the frontend of sites. It's important that it is consistent with the Seven style guide and that other admin themes can control the look and feel.
Proposed resolution
Our CSS standards define module CSS as: “the minimal styles needed to get the module's functionality working.”
Theme CSS is defined as: “extra styles to make the module's functionality aesthetically pleasing. ”
Move the theme styling into the Seven theme
Add a library alter hook to load the admin theme CSS. Example: #2341221: Node preview bar has usability issues, is difficult to use on mobile, not usable without Bartik, and does not align with the Seven style guide and current toolbar designs
Remaining tasks
Write the patch.
Test.
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#11 | core-move_toolbar_theme_css-2539992-11.patch | 31.79 KB | bruvers |
#8 | ScreenShot-no-edit-button.png | 176.75 KB | oheller |
#8 | ScreenShot-original.png | 275.44 KB | oheller |
#6 | interdiff-core-move_toolbar_theme_css-2539992-3-6.txt | 775 bytes | rajeevk |
#6 | core-move_toolbar_theme_css-2539992-6.patch | 10.85 KB | rajeevk |
Comments
Comment #1
LewisNymanComment #2
bruvers CreditAttribution: bruvers at Wunder commentedWorking on this.
Comment #3
bruvers CreditAttribution: bruvers at Wunder commentedThe patch moves
toolbar.theme.css
andtoolbar.icons.theme.css
to the Seven theme. It also adds ahook_library_info_alter()
implementation intoolbar.module
to include the stylesheets from the new location in Seven's theme folder.Comment #4
bruvers CreditAttribution: bruvers at Wunder commentedNeeds review now.
Comment #5
LewisNymanGreat thanks. I applied the patch and here are some screenshots.
Looking good with Seven as the admin theme:
Stark as the admin theme with Bartik on the frontend:
Same but with the tray collapsed:
Stark toolbar with Stark loaded:
We need a blank line at the end
We need to change this as the name as changed. It would be nice if we could put more than the file name, like "Visual styling for the administration toolbar"
Comment #6
rajeevkCorrected with points raised by @LewisNyman & attaching the patch with interdiff.
Comment #7
rajeevkComment #8
oheller CreditAttribution: oheller at Breakthrough Technologies, LLC commentedLooks like the Edit button in the toolbar for turning on and off the contextual links has lost some styling.
Comment #9
oheller CreditAttribution: oheller at Breakthrough Technologies, LLC commentedNevermind, I just realized that the whole idea is the make the theme handle the edit button too. Because none of the other themes are addressing the toolbar, none of it's styled.
Comment #10
LewisNyman@oheller Yeah but it should be functional. You should be able to read the text.
Comment #11
bruvers CreditAttribution: bruvers at Wunder commentedThis improved patch just adds the line "Visual styling for the administration toolbar." to toolbar.css. The toolbar edit button text is not visible because of styles in contextual.toolbar.css that hide the button text. To keep this issue small and focused I've created a new issue for the toolbar edit button text #2568743: Administrative toolbar edit button text not visible in Stark.
Sorry, no interdiff because the previous patches did not apply correctly anymore.
Comment #12
irina.rozite CreditAttribution: irina.rozite at Wunder commentedLatest patch resolves the issue. Theme toolbar CSS is moved to the Seven theme and functionality is not broken for other admin themes. Issue with "Edit" button text visibility is resolved in child issue #2568743
Comment #13
LewisNymanThanks. Setting this to postponed on #2566775: [Voltron patch] Move all remaining *.admin.theme.css to Seven
Comment #14
Manjit.Singh#2566775: [Voltron patch] Move all remaining *.admin.theme.css to Seven is active.
Comment #15
andypostwhy admin theme library injected into main theme?
toolbar should get overrides for its libraries from themes
Comment #16
star-szrHmm yeah at this point we could just use libraries-extend rather than add another magic key to info files. What do other think?
Comment #17
andypostotoh moving all theming to seven will break toolbar for bartik so...
only minimal split needed or maybe just a clean-up or wont fix?
other themes could override
toolbar.theme
part of library alreadyComment #18
star-szrWe won't break Bartik because we have Stable in place :) so we are free to make sensible decisions as to what makes sense to keep in core or where things should live in our @internal themes, Bartik and Seven.
Comment #19
drintios CreditAttribution: drintios at Skilld commentedWe can use libraries-extend but, we also need to check issues with icons cause toolbar can get broken.
Which icons are we using ?
We will have custom ones ?
Different ones for seven ?
Comment #20
star-szrI don't think this issue is about changing the visual appearance of Seven or Seven's toolbar per se - if that were to happen it should be in a separate issue.
I think we may even want to use a libraries-override in Seven to remove the Stable toolbar CSS, or for that matter just use override instead of libraries-extend :)
Comment #27
lauriiiComment #28
lauriiiComment #35
bnjmnmNeds issue summary as
Theme CSS is defined as: “extra styles to make the module's functionality aesthetically pleasing. ”. Given this issue is 8+ years old, we should establish that this is still worth pursuing even if it might disrupt the way many sites are accustomed to.