Problem/Motivation
Some modules mix toolbar CSS with other CSS. It is common to override module CSS without overriding their toolbar CSS, or vice versa.
Proposed resolution
Move toolbar related CSS to [module_name].toolbar.css files. This pattern is already implemented in contextual module. Implement this into Shortcut and User modules as well.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | 3045467-nr-bot.txt | 144 bytes | needs-review-queue-bot |
| #30 | 3045467-30.patch | 19.68 KB | sakthivel m |
| #29 | 3045467-29.patch | 4.12 KB | sakthivel m |
| #22 | 3045467-22.patch | 19.69 KB | gauravvvv |
| #22 | interdiff-21_22.txt | 602 bytes | gauravvvv |
Issue fork drupal-3045467
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
lauriii@bnjmnm on Slack
That is a good point. I'm wondering if it would make sense to have toolbar related icons in
[modulename].toolbar.cssfiles since you would likely only override those icons if you are restyling toolbar. I would be fine also with creating[modulename].icons.toolbar.cssfor toolbar specific icons. What is important is that toolbar icons shouldn't be in the[modulename].icons.cssfile because it is not a common scenario to override both of the module icons and the toolbar icons in the same place.Comment #3
bnjmnmI went with the second suggested approach of adding
[modulename].icons.toolbar.cssfiles, as the library names that use these files would all still make sense. Otherwise, a library likedrupal.user.iconswould need to be renamed. I wasn't sure if renaming libraries would be disruptive to contributed modules so erred on the side of caution. If there's a preference for fewer files that can be done if renaming libraries is OK.It seemed like Settings Tray may require this refactoring as well. There is already a
settings_tray.toolbar.cssfile, but there is also some toolbar related css found in all the module's other css files. This has me wondering if it was intentional and thought it would be best to get input before making the change.Comment #4
lauriiiWe don't want to accidentally override someones overrides. We probably should refrain from making this change in Stable at all, and only keep it in the core until Drupal 9. We should revert all CSS changes to Stable, and set these CSS files to false so that they don't get loaded in theme extending Stable.
The Settings Tray CSS is a nice catch. I think we should move those to the toolbar file as well.
Comment #5
bnjmnmComment #7
lauriiiThis should fix the test failure.
Comment #8
lauriiiI accidentally removed a newline. Added it back in this patch.
Comment #9
lauriiiComment #10
huzookaDuring review I noticed that the patch from #8 is a bit outdated (53 offset for
core/themes/stable/stable.theme).Comment #11
huzookaComment #12
huzookaComment #13
huzookaComment #14
huzookaReview of the re-rolled patch #13:
I think that most of the refactoring are fine. This applies to
contextual,shortcut,tourandusermodules.But since I see that
settings_traygets some selector changes, I want to share my related feedback:I'm sure that we want to change only the contextual toolbar item, and not every toolbar item that has the edit icon. So we should change this selector to
.contextual-toolbar-tab .toolbar-icon.toolbar-icon-edit:beforeSame situation as #1: change to
.contextual-toolbar-tab .toolbar-icon.toolbar-icon-edit.is-active:beforeSame situation as #1: change to
.contextual-toolbar-tab .toolbar-icon.toolbar-icon-edit:hover:beforeI cannot find elements that match these selectors, but anyway:
.toolbar-icon.toolbar-icon?If the tray is active, these wont be visible because every other toolbar item gets the visually-hidden class. I'd remove these.
Same situation as #1: change these to
.toolbar .toolbar-bar .contextual-toolbar-tab .toolbar-item[.is-active||:focus](selector structure based on the one fromtoolbar.theme.css)Change to
.toolbar .toolbar-bar .contextual-toolbar-tab .toolbar-item[:hover||.is-active]Change to
.toolbar .toolbar-bar .contextual-toolbar-tab .toolbar-item.is-active:hover(selector structure based on the one fromtoolbar.theme.css)Instead of increasing the height, we should add toolbar library as explicit dependency (because it IS a dependency imho).
Comment #15
vacho commentedComment #20
sakthivel m commented#13 Patch Failed
Comment #21
sakthivel m commented#21 Please review the patch
Comment #22
gauravvvv commentedFixed custom command failed. Attached interdiff for same.
Comment #24
sakthivel m commentedComment #27
pradipmodh13 commentedLast patched has failed so I'm moving to needs work.
Comment #28
pradipmodh13 commentedComment #29
sakthivel m commented#29 Please review the patch
Comment #30
sakthivel m commented#30 Please review the patch
Comment #32
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #35
djsagar commentedGetting error while applied patch #30, creating MR.
Comment #37
djsagar commentedComment #38
djsagar commentedPipeline issue need to fix so moving NW.
Comment #41
sakthi_dev commented@djsagar Didn't notice that you are working on it.