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.
Problem/Motivation
we have to many css floating around that dont do much more than add a bit of css to seven
Its confusing for everybody why & where it comes from so lets clean it up
search.admin.css dont contains anything that makes it critacal for it to function, its pure layout
.search-admin-settings .container-inline {
margin-bottom: 1em;
}
.search-admin-settings label[for="edit-search-type"] {
display: block;
}
Proposed resolution
move the css over to seven, where it belongs
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#22 | after_2.png | 87.93 KB | Chernous_dn |
#22 | before_2.png | 87.91 KB | Chernous_dn |
#20 | move_search_admin_css-2491259-20.patch | 2.5 KB | Chernous_dn |
#14 | move_search_admin_css-2491259-14.patch | 2.44 KB | Chernous_dn |
#14 | style.png | 125.81 KB | Chernous_dn |
Comments
Comment #1
rudraram CreditAttribution: rudraram at Axelerant commented@mortendk the title of this issue should be move search.admin.css into seven.
You have already added the Issue for file.admin.css here #2491253: move file.admin.css into seven
Comment #2
rudraram CreditAttribution: rudraram at Axelerant commentedAdded patch as per the proposed resolution
Comment #3
rudraram CreditAttribution: rudraram at Axelerant commentedComment #4
mortendk CreditAttribution: mortendk as a volunteer commentedComment #5
jhodgdonLooks probably OK, maybe some Before and After screen shots in Seven and Stark would be useful though?
Comment #6
jhodgdonComment #7
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commentedUpdate patch #2 add
search.admin.css
toseven.libraries.yml
Comment #8
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commentedAdd screenshot.
Comment #9
jhodgdonThanks for the patch and screenshots! Can we also get screenshots in the Stark theme (before and after)?
Hopefully Cottser can review the patch as far as whether putting it in that place in Seven is the right thing to do. I'm not sure how Seven is organized.
But I think the patch also needs to change module/search/search.libraries.yml to take out the admin CSS file (and its library) there? And then I guess somewhere the library that is defined in there is referenced in some search.module code, so that reference would need to be removed as well?
Comment #10
jhodgdonIt looks like the reference to the attached library is in /core/modules/search/src/SearchPageListBuilder.php:
So that needs to be removed. And it seems like Seven should only be using this search.admin.css if you're on that page?
Comment #11
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commented@jhodgdon thanks for the help. I update patch. But I can't check in the Stark theme. I have error (screenshot).
Comment #12
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commentedComment #13
jhodgdon@Chernous_dn: That Stark problem seems like a pretty serious bug! If it persists we should definitely file an issue.
Regarding the latest patch, I think we still need to remove the entry in the search.libraries.yml file that references this CSS file, right?
And I also would have thought that this CSS file in Seven would only want to be included when we're actually on the Search settings page... it seems like the way this patch is written, this CSS file would be included on every page that uses the Seven theme. I do not know if this is standard Seven behavior or not, but previously due to that #attached line in the Search class (referenced in previous comment), this CSS file was only being included if we were on that one page. ??? Possibly the Seven theme maintainers can comment here; since I (one of the Search maintainers) am already subscribed to this issue, I think I'll move this issue component to make sure the Seven maintainers see it.
Comment #14
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commented@jhodgdon thanks again. I update patch and remove in the search.libraries.yml references. I think it's normal CSS file included on every page, because the rest of the files are also on every page. (screenshot)
Comment #15
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commentedComment #16
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commentedComment #17
jhodgdonThanks! Looks OK to me then. Still would like to see (a) Stark before/after screen shots and (b) comment from Seven maintainers about whether this CSS should be put where this patch puts it and used on every admin page.
Comment #18
jhodgdonActually I'd like to see a screen shot from Bartik too.
Comment #19
LewisNymanIf this is admin only styling then we shouldn't test Bartik. We'd be taking on a heavy burden if we decided that Bartik supports all admin interfaces.
The name of this file should match the class styled within it. In this case it's
search-admin-settings
.Comment #20
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commented@LewisNyman thanks. Update patch.
Comment #21
jhodgdonThanks! Given that this is a new patch, maybe we should have screen shots for Seven and Stark again please?
Comment #22
Chernous_dn CreditAttribution: Chernous_dn at FFW for FFW commented@jhodgdon Add screen for Seven. For Stark this style not work.
Comment #23
LewisNymanThat's correct, Stark should not have any styling. I feel like this patch has been sufficiently tested. Thanks!
Comment #24
jhodgdonWhat I was wondering was whether without the CSS that was previously in Stark because it was in search.module, the page is entirely broken in Stark. But perhaps we don't care about that... I guess that is the point of Stark.
Comment #25
LewisNymanhmm, well the page shouldn't be broken, it should still be functional. It can look bad, but only as bad as unstyled HTML looks: http://info.cern.ch/hypertext/WWW/TheProject.html
Comment #26
jhodgdonI just tested this patch in Stark. I would put it in the "ugly but usable" category. So let's go ahead, since Lewis has confirmed the CSS file has been moved to the right place now. Thanks!
Comment #27
alexpottCSS is not frozen in beta. Committed 9ae518c and pushed to 8.0.x. Thanks!