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
#1993334: Add HTML5shiv to Stable and Classy only tried to remove html5shiv from core. The motivation behind it was that core does not support IE8 any longer. If you're building a modern front-end, you'll drop support for IE8 - and maybe even IE9. This means there no need to include html5shiv. When creating a new Drupal 8 theme, html5shiv is always loaded; and it not documented on how to get rid of html5shiv in your theme.
Proposed resolution
- Get #1993334: Add HTML5shiv to Stable and Classy only in and just remove shiv … but that seems unlikely.
- Write documentation on how you can remove this library.
Remaining tasks
…
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#18 | interdiff.txt | 662 bytes | joelpittet |
#18 | remove_html5shiv_from-2409083-18.patch | 5.06 KB | joelpittet |
#16 | remove_html5shiv_from-2409083-16.patch | 5.06 KB | joelpittet |
Comments
Comment #1
sqndr CreditAttribution: sqndr commentedComment #2
attiks CreditAttribution: attiks commentedComment #3
attiks CreditAttribution: attiks commentedAccording to #2412945-6: Determine which additional asset libraries should be in the critical path/loaded i/t header (core/drupal, core/dropbutton) it is wrapped inside conditional IE8 comments
Comment #4
Wim LeersRoughly:
hook_element_info_alter()
, dounset($types['html']['#attached'])
.Comment #5
sqndr CreditAttribution: sqndr commentedDoes
hook_element_info_alter()
work? I'm working on Panda theme. I've implemented the hook insidepanda.theme
, without any result. If I addexit;
to file and reload, the page is blank, so I'm sure Drupal reads the file. Then I went to core'sseven.theme
, because it's implementing the hook as well. I tried several ways of adding and removing things in this hook (Seven implements), but it seems to me it's not doing much?Comment #6
Wim LeersIt doesn't work in your Panda theme, because:
… it's only invoked for modules. I think that's a bug; themes should be able to alter existing elements, even if only to attach their own assets to it. (Or, in this case, to remove it.)
Pinging catch about that.
Comment #7
sqndr CreditAttribution: sqndr commentedThat's what I thought … but yeah, it should be reported as a bug because Seven implements the hook as well ;) Let me know the result!
Comment #8
Wim LeersAsked catch, his response:
So we can fix #6, but we'll have to make sure elements are cached by theme. All render caching already happens per theme (for analogous reasons), so there's no problem there.
Comment #9
Wim LeersComment #10
sqndr CreditAttribution: sqndr commentedComment #11
sqndr CreditAttribution: sqndr commentedSince #2448843: [regression] Themes unable to implement hook_element_info_alter() got fixed, need to test this again, because this should now be possible.
Comment #12
sqndr CreditAttribution: sqndr commentedComment #13
joelpittetPostponing this as well
Comment #14
joelpittetWe may be able to start working on this for 8.1
Comment #15
joelpittetHere's a patch to remove it from being loaded but leaves it in core.
Comment #16
joelpittetWith patch
Comment #18
joelpittetWhoops forgot my regex delims
Comment #21
joelpittetWhoops this is a duplicate now of #1993334: Add HTML5shiv to Stable and Classy only