Problem/Motivation
As part of #3094468: [plan] Update core JavaScript (and CSS) dependencies prior to 9.0.0-beta1 we need to update Normalize.css to the most recent version - 8.0.1
Proposed resolution
Update normalize.css from 3.0.3 to 8.0.1.
Since Drupal core themes will not depend on Stable in future (#3110855: Plan for removing dependency to Stable in Bartik/Seven/Claro/Umami), evaluate the changes (which are considerable) and determine which would cause unwanted regressions in core. If the regression is due to a bug/misjudgement in normalize.css, address in a normalize-fixes file. For other regressions, and provide customizations within the core theme experiencing the regression.
Once these regressions have been identified and addressed, add normalize.css version 3.0.3 as a BC layer to Stable. This means that themes depending on Stable (and by extension, Classy), will not be impacted by the update to normalize.css 8.0.1.
User interface changes
Drupal core themes are not impacted until #3094468: [plan] Update core JavaScript (and CSS) dependencies prior to 9.0.0-beta1. Minor regressions are expected in themes not extending Classy or Stable due to changes in normalize.css.
Remaining tasks
Review each difference between normalize 3.0.3 and 8.0.1 to determine what may be impacted
Manually look for regressions and address as needed
Run Wraith regression tests, using the previous steps to determine where efforts should be focused
For regressions surfaced by Wraith, determine if they are acceptable changes. Update themes to address the changes that are not acceptable
Add Normalize 3.0.3 to Stable, including the previous normalize-fixes, which is not necessary with normalize 8.0.1
Original report
Problem/Motivation
Firefox 49 is out and has support for <details> which means our polyfill doesn't kick in. Normalize.css sets <details> and <summary> element as display:block which means Firefox won't display the marker, they fixed this in 5.0.0 (https://github.com/necolas/normalize.css/issues/604).
Checkout comparison aligned by @droplet: (removed comments & unchanged rules, re-reordering to match v3)
https://www.drupal.org/files/issues/diff-manual-aligned-by-%40droplet.patch
Here are the change logs for Normalize.css, starting at 4.0.0 (scroll up): https://github.com/necolas/normalize.css/blob/f06565fe8e0e1ad1b88f273271.... There are a lot of changes due to reorganization/sectioning of the code as well as comment changes.
There is one notable change that causes a regression in, at least, Seven: https://github.com/necolas/normalize.css/commit/02c5c7adbbec1707900fde86..., see the attached screenshot.

There may be regressions upgrading from 3.0.3 to the most recent normalize.css.
Proposed resolution
Upgrade core's Normalize to most recent version.
Normalize 3.0.3 should be copied to Stable. Stable needs to continue using 3.0.3 for BC.
Release note
The Drupal core normalize.css has been updated from 3.0.3 to 8.0.1. Themes that are not extending Stable or Classy should manually test in case they need to update. Stable theme will continue using normalize.css 3.0.3 for backwards compatibility. Read the change record on the normalize.css upgrade for more information.
| Comment | File | Size | Author |
|---|---|---|---|
| #120 | 2821525-120.patch | 23.48 KB | bnjmnm |
| #120 | interdiff_118-120.txt | 2.37 KB | bnjmnm |
| #118 | interdiff_114-118.txt | 4.33 KB | bnjmnm |
| #118 | 2821525-118.patch | 24.33 KB | bnjmnm |
| #114 | interdiff_101-109.txt | 3.38 KB | bnjmnm |
Comments
Comment #2
chrisrockwell commentedComment #3
chrisrockwell commentedComment #4
chrisrockwell commentedComment #5
droplet commentedDrupal still support IEs for awhile.
I think it needs a better comparison to see what style actual changed.
Comment #6
chrisrockwell commented@droplet normalize 5.0.0 still supports IE8+, can you tell me what kind of comparison you'd like to see? I don't have IE8 but I'll see what I can do.
Comment #7
chrisrockwell commentedComment #8
droplet commentedJust list the actual changes (what's added & removed between v3 ~ v5)?
For example these few lines, there're no real changes. And many styles just move up and down.
Comment #9
chrisrockwell commentedI added a link to the changelog in the issue summary, do you think they should be copied here?
Comment #10
droplet commented@chrisrockwell,
It doesn't point out every change, all reviewers still have to scan full patch once.
I noticed one thing, do you modify the code style?
https://github.com/necolas/normalize.css/blob/5.0.0/normalize.css
Comment #11
chrisrockwell commentedI didn't intentionally modify anything, but it looks like the comments broke to the next line (in other places as well). I'll take a stab at mimicking what you did here: #2217523: Update normalize.css to v3.0.1.
Thanks!
Comment #12
chrisrockwell commentedFixed issues with comments breaking to next line.
Comment #13
chrisrockwell commentedFixed issues with comments breaking to next line.
Comment #14
chrisrockwell commentedComment #15
chrisrockwell commented@droplet are you available on IRC or Slack? With the exception of the border-collapse I'm struggling to come up with a "Notable Changes" section that isn't a mirror of the change log. What I've done below is tried to highlight the "opinionated" changes, since it appears normalize.css is trying to move opinionated changes into another css file (sanitize.css I believe)
Update of opinionated style
Removal of opinionated
Removed opinionated cursor
Fix summary (not opinionated but helps since FF now supports
detailsComment #16
droplet commentedHere's a better comparison. Manual aligned. Never want to do it again.
It seems not so possible to add to CORE though. Apparently, some changes will break the designs.
Comment #17
chrisrockwell commentedThanks @droplet. There is a declaration missing:
[hidden] { display: none }but I didn't review it all.I guess the more important question that we need feedback on is, is this even viable? As someone that is very new to trying to contribute my take on this would be:
We have adopted a library into core. There will inevitably be revisions to that library as browsers add support for elements, bugs are found, etc. If we stop updating it now because of a regression, what do we lose out on in the future? If we go that route, we put the burden back on theme maintainers to stay up-to-date with normalize (at that point why even have it?).
On the other hand, we update it and supply patches to core themes (I'm assuming the core themes are the ones that are under consideration for regressions) as necessary.
Again, I'm literally a couple weeks into trying to be an active contributor, so take this with a grain of salt.
Comment #18
droplet commentedthis rule is merged, and no changes between v3 & 5.
(** this is not a final patch but for reviewing only)
On other points, I understand your concerns :)
Based on my personal experience,
I'd say take the newer version. and then add these back to CORE
line-height changes needed discussion
and all others change I think that's acceptable and will not make a big visual break
Comment #19
droplet commentedComment #20
chrisrockwell commentedThanks @droplet. I can't imagine the table-collapse change breaking layouts (other than a visual regression) so to add it back in and then forever have to maintain that patch as normalize.css updates seems more fragile than submitting patches to core themes.
Tagging this for review to maybe get some additional feedback.
Comment #21
alexpottI re-created the patch locally by just getting https://raw.githubusercontent.com/necolas/normalize.css/5.0.0/normalize.css...
I looks like the patch in #12 adds a new line, incorrectly. Patch fixes that.
I think it is important we keep this up-to-date.
Comment #22
alexpottComment #23
star-szrThanks everyone. Extra shout out to @droplet for the work on creating that diff, very helpful!
Can we please get a follow-up issue filed (and related to this issue) for adding the border-collapse and any other needed CSS to Stable and/or Classy? I think Stable would make sense in this case. I want to make sure that doesn't slip between the cracks.
Comment #24
joelpittetFollow-up created, hopefully got the intention of it correct in the issue summary.
#2845106: Add needed diff between normalize.css 3.0.3 and 5.0.0
Back to RTBC
Comment #25
alexpottHmmm... surely the new CSS to ensure things don't change has to be added in this issue?
Comment #26
joelpittetI'm ok with that being added in this issue too and was thinking that would be the case. Thought @Cottser had a commit plan in mind, so went with it... like improv;)
Comment #28
star-szrYeah, sorry, what @alexpott said in #25 does make more sense because then we don't get the regression at all.
Comment #29
joelpittetThanks @Cottser, move the IS changes into this issue, let's do it here.
Comment #31
chrisrockwell commentedI've gone through a lot of pages in two clean installs, one with this patch, and the only regression I can find is caused by the border-collapse so I added it to system.admin.css. I'm wondering if we need a table.css component instead though but, I think, that would require adding a table.css to core/modules/system/css as well (I think the tests check).
Comment #33
xjmLooks like the test failure was the known intermittent failure of
OutsideInBlockFormTest; the patch is passing again now. Setting back to NR.Comment #34
xjmNot in 8.3.x yet, although I think we could still consider backporting this if it does land, especially before RC.
Comment #35
xjmFor now. We debated whether this could go in during RC/patch release, but I am leaning away from that since it's technically a major version change and includes frontend API changes. So by marking it with the deadline now, we can be sure to at least revisit it.
Comment #36
xjmForgot to adjust branch. If we don't get this in for RC it can be moved back to 8.4.x.
Comment #37
alexpottI'm not sure that this is the right place to load add this css. Normalise is loaded on every page - this is loaded with the admin library. Ideally this would go in a component that is part of base library defined in system.libraries.yml
Comment #38
alexpottRe #31 I think you are correct - we should add this in as part of the system's component css. Maybe stable should implement a hook_library_info_alter() to do this.
Comment #39
chrisrockwell commented@alexpott I'm not 100% sure I'm following your recommendations to use
hook_library_info_alter. Can you take a look at the attached which moves theborder-collapseto a new system component css file and copies that to stable (as required)?[EDIT: this patch also fixes the normalize version number in
core.libraries.ymlas that was overlooked.]Comment #40
chrisrockwell commentedI'll fix this
Comment #41
chrisrockwell commentedFix #40.
Comment #42
xjmSince 8.3.x is now in commit freeze for its release candidate phase, this major version dependency update should now be targeted for 8.4.x. Thanks!
Comment #44
droplet commentedStill possible get into 8.4?
Comment #45
gagarine commentedUsability is preferred over UX, D7UX, etc. See https://www.drupal.org/issue-tags/topic
Comment #46
droplet commentedEverything is over-engineering in Drupal. Seriously, it took 11 months for a simple task. (I do not blame any contributors in this issues thread but we have a real contribution workflow problem.) normalize.css has been released 2 more major version.
Comment #47
andypost7.0.0 is released https://github.com/necolas/normalize.css/releases/tag/7.0.0
Comment #48
joelpittetOne thing to consider is that normalize has taken a large departure from it's previous versions... bootstrap forked the project because of this change.
https://blog.getbootstrap.com/2017/08/10/bootstrap-4-beta/
Comment #49
droplet commented@joelpittet BS4 merged normalize with their standard style. It might not possible to do in Drupal CORE. (Not sure, But a huge workload to maintain the updates)
Comment #51
jhodgdonI haven't been following this issue and haven't read the 50 comments here... but I'd like to point out that on #2886904-29: display: block for details/summary hides drop arrows in Firefox (normalize.css update), the patch there from #6 (which updated normalize.css to version 7) was tested on IE and Edge, and it was broken as far as the drop-down arrows that are referenced on that issue.
Since the change for the drop-downs was added to Normalize before 5.0, I think it would be a problem there. I filed an issue in the Normalize project:
https://github.com/necolas/normalize.css/issues/740
Comment #52
andrewmacpherson commentedCouldn't we make use of libraries API declaration at the theme level? Say, copy normalize-v3 to the Stable theme, and use
libraries-overrideto establish it there. Then it could be updated more frequently in core/assets, and other themes (core, contrib, or custom) could choose to opt-in to the lastest version in core/assets, keep going with v3 from Stable, or bundle their own copy of normalize?Would issues like #2886904: display: block for details/summary hides drop arrows in Firefox (normalize.css update) would be easier to address this way?
Comment #53
jhodgdonProbably we could, but what I was trying to say in #52 is that newer versions of normalize fix Firefox while breaking IE and Edge for the problem we're trying to solve in #2886904: display: block for details/summary hides drop arrows in Firefox (normalize.css update)... If we were to adopt a newer version of Normalize, we'd definitely need some extensive manual testing to see what else might have been changed/broken in various browsers, and then we'd need to introduce fixes so we don't break the core Seven and Bartik themes.
Comment #56
lauriiiComment #57
lauriiiI don't think we can safely update normalize.css without providing BC layer in stable. This does force us to keep two versions of the library at once. Luckily normalize.css only consist of CSS, which means it will result in only a little bit of overhead. We should try to update this before Drupal 9 so that this gets shipped as part of Drupal 9 stable.
We're working on a new browser support policy in #2390621: [policy, no patch] Update Drupal's browser support policy. As part of the issue, we are dropping support to lots of old browser versions. This could allow us to update to the most recent version of normalize.css.
Comment #59
bnjmnmSwitching this to a 9.0.x patch.
I did some issue summary updating, but also adding the "Needs issue summary update" tag as it will require more before this is ready for review.
Comment #60
bnjmnmComment #61
bnjmnmNo interdiff since this is applying to 9.0.x and with a much newer version of normalize.css
Not sure if there's a good way to manually test since stable is still using the prior version of normalize.css. If there are issues they will surface as themes decouple from Classy and Stable, but if there are particularly at-risk areas they could be tested with Stark.
Comment #62
tedbowI didn't know who to test this so I did a small experiment where I ran a pre-existing test and output screenshots
\Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTest::testInlineBlocks()as test casediff -rq folder1 folder2to see if the exact same screen shots were produced each time.I will attach the non matching screenshots and the patch I used to make the screen shots.
I am not sure if such a small change is important. Maybe we should run the same process on some other tests?
Comment #63
bnjmnmThis will require some browser-specific testing of elements that are impacted by normalize.css, specifically the rules that actually change something from the browser default stylesheet. I'll get some info and screenshots on that so it's not a beast to review.
Comment #64
bnjmnmWent through every change between 3.0.3 and 8.0.1 and narrowed it down to ones that could potentially impact Drupal
https://github.com/necolas/normalize.css/issues/506
These rule is no longer present.
The commit message states that it's part of removing no longer supporter browers (incl IE9 and below)
Unsure why this was removed as it impacts 10/11 still.
https://github.com/necolas/normalize.css/commit/004d58b2f2e0ac3d03d075f8...
NO LONGER PRESENT
Note that version 4.4.1, this rule was changed for less specificity
https://github.com/twbs/bootstrap/commit/900775483ff0d5aa79e497fbfee8985...
to Just
https://github.com/necolas/normalize.css/commit/b5f0e9d79a997952f0d68f55...
NO LONGER PRESENT
input[type="search"]looks slightly different in SafariBefore
After
https://github.com/necolas/normalize.css/commit/b5f0e9d79a997952f0d68f55...
NO LONGER PRESENT
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
}
fieldset padding also changed from
padding: 0.35em 0.625em 0.75em;topadding: 0.35em 0.75em 0.625em;NO LONGER PRESENT
AFTER
NO LONGER PRESENT
line-height: 1.15;added to<html>This was to add consistency to most browser defaults being line-height:normal. There are several conversations regarding this change, this one seems to have the most info + links to others. https://github.com/necolas/normalize.css/issues/612Comment #65
bnjmnmI went through each potentially-disruptive change in #64 to see if they were in fact disruptive. Added core examples when I could find them (refer to that comment for details about the rules).
<table>,<td>,<th>Modernizr 3.0.3
Modernizr 8.0.1
This is still an issue in IE11, should not have been removed as a rule outside of their supported browsers.
This should be a 1/4 circle, but is not with Modernizr 8.0.1
Modernizr 3.0.3
Modernizr 8.0.1
reviewed every desktop browser's default stylesheet and none provide outlines on
a:active,a:hoverSearch input styling changes on Safari and Chrome
Safari
Chrome
This is overridden in every core and popular-contrib instance I could find, but it still changes things from the default, and contrib or custom could be expecting this styling.
Screenshot from Chrome with only normalize.css
Tried this on every supported desktop browser - mobile isn't needed since it's cursor styling (i think...)
The default stylesheet for these has the same rule.
It's an opinion, granted, but the
<abbr>change may be welcomed?Safari
Chrome/Firefox
This could result in
<pre>elements that had scrolling to instead flow outside of their container.I couldn't find a scenario with core themes where this would have an impact, but a line-height declaration on
<html>is quite capable of altering the appearance of something contrib/custom. This is a good rule to have, but may not be ideal to introduce to an existing site, particularly since it's not something that can provide deprecation warnings to maintainers. This change has received some complaints https://github.com/necolas/normalize.css/issues/612Some of these changes may be acceptable since Stable (8) will still use normalize 3.0.3, and perhaps some changes in 9 can be accepted even if they can't receive deprecation coverage. Some, like table and search, don't seem acceptable and a custom solution may be necessary.
Comment #66
lauriiiThank you for the thorough research @bnjmnm! 👏I think it's fine for us to proceed with updating the core version of normalize.css. I checked whether this affected the Bootstrap theme. It seems like they ship with their own version of normalize.css, meaning that this change won't affect them. I'm wondering if we should ship with normalize.css as part of core (rather than Classy) at all since it's only being loaded there. Maybe we could open a follow-up to determine that?
I think we should open upstream issue for #64.2. We should also consider fixing this in core while we wait for this to be fixed in the upstream package.
#64.1 and #64.4 we should solve this in the affected themes. This becomes relevant once we move forward with #3050389: [META] Remove dependency to Classy from core themes.
Comment #67
bnjmnm#64.2 Opened a PR for the SVG issue https://github.com/necolas/normalize.css/pull/806. The normalize.css repo has been inactive for ~14 months so I'm not sure if it will get any traction, but it's also possible that the current PRs/issues are things that are less straightforward.
Will provide a patch with fixes for items 1,2,4 in #64 next.
Comment #68
bnjmnmThis provides additional CSS to address items 1,2 & 4 in #64 Discovered some of the issues were due to a removed line-height rule that normalize.css added for FF4, but is now baked into some assumptions in core.
Debated commenting all the new rules, but in most cases it seemed like it could cause more confusion than benefit as they're not particularly different from nearby uncommented rules. We'll let this get figured out via review.
Comment #69
lauriiiThank you for opening the upstream PR! 👏
What are the steps for testing the changes in #68?
Should we allow overriding the library version and other values? If we override the library with a different version of the library, value of this property is not correct anymore.
Comment #70
bnjmnmI got hung up on the override not allowing
version:then realized I could just replace the whole library, so that's all set now.The patch also changes Claro's pcss file instead of the css, because we all need that to happen to us at least once.
It's not a straightforward process because the patch includes stable using normalize.css 3.0.3. To make this testable I added a patch specifically for testing. This removes the override, so themes are using normalize.css 8.0.1.
The patch also includes a comment with every rule that was added to fix issues caused by the normalize.css update, you can find these comments by searching for the string
TEST-2821525. To see the difference with/without the fix, follow the steps in each comment and comment the CSS rule to see the difference.Here are before/after screenshots of each added rule.


Input line height - chrome - bartik - not fixed
Input line height - chrome - bartik - fixed
☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️
Input line height - chrome - seven - not fixed


Input line height - chrome - seven - fixed
☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️
Search input cancel button - safari - bartik - not fixed


Search input cancel button - safari - bartik - fixed
☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️
Search input cancel button - safari - seven - not fixed


Search input cancel button - safari - seven - fixed
☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️
Table styling - all browsers - claro - not fixed


Table styling - all browsers - claro - fixed
☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️
Table styling - all browsers - seven - not fixed


Table styling - all browsers - seven - fixed
Comment #72
damienmckennaTagging as a requirement for Drupal 9.0-beta1.
Comment #73
dyannenovaI've run visual regression testing on the patch using Wraith, and spidering through all of the paths in a Standard Drupal core install. This tested around 1500 paths at 5 different resolutions. The only differences that were found were due to content differences between the test sites (e.g. timestamps), so I think that this is ready to go from the standpoint of matching experiences and the CSS changes make sense to me from an overall architecture viewpoint.
Comment #74
lauriii@DyanneNova Thank you for doing manual testing on this! It would be useful to get a bit more information on what was being tested. Which patch did you use for testing? Also, which themes did your test cover?
Comment #75
xjmAccording to @DyanneNova, the testing patch was used, and Seven and Bartik were tested. She's going to look into testing Claro and Umami (which will take a long time because of all the content paths it has).
Comment #76
bnjmnmMade the issue summary current.
Comment #77
dyannenovaI've tested the testing patch with Claro and Umami now and found no differences besides content differences, so I think that this is looking good to go.
Comment #78
lauriiiI did a bit of manual testing and I found the following regressions that should be still addressed:
Comment #79
bnjmnmVery good catches in #78! The majority of these are issues that were already solved in some themes, but obviously not all of them. Eventually it became clear that the regressions were all best addressed within the library instead of theme-specific changes. Fewer overall changes and easier to document the ones that were added.
Will follow this up with manual review and screenshots.
Comment #80
lauriiiI'm wondering if these are actual regressions or just changes of behavior? If we ship these as part of the normalize-fixes, it means that these will be shipped to all themes, not just core themes. Is that what we actually want?
Comment #81
bnjmnmRe #80
\
My earlier patch leaned more in the direction of theme-specific, but based on the feedback in #78, I believe this is what is want (with one possible exception).
I'll go through each of the items in normalize-fixes:
This is to address a bug in Normalize.css, which I've submitted a PR for.
This was one I initially categorized as a change in behavior and did not provide any changes. Since it was pointed out in #78 as something that should be addressed if possible, it was added. It was placed in normalize-fixes as it was reported as occuring in Bartik + Umami, and Claro + Seven have no rules specifically targeting this element.
This was already added to Bartik and Seven for
<input>. #78 revealed this is also occurring withselect, and I found this to be the case with<select>and<input>with Umami as well. These examples led me to believe that there are likely more unwanted surprises to come that result from normalize.css 8.0.1 introducing font-size and line-height to these elements with this rule:These were already necessary additions to Claro and Seven. I moved it to normalize-fixes after #78 pointed out the table difference in Bartik. I suspect this got past manual testing as tables on the FE theme are not as common, and should have explicitly tested for this. This will likely impact Umami in the same way as it has no styles specific to table/tr/td elements.
This was initially added to just Bartik and Seven, and I opted to move it to normalize-fixes for consistency, but upon review I'm leaning towards moving this back to just Bartik and Seven and creating a followup to address the styling issues that result from the webkit search cancel button being visible, so this functionality can be present in all themes.
Normalize 3.0.3 set this element to display:none. This rule was removed because it's effectively removing functionality inherent to input[type="search"], so it would be nice to fully remove it from core, too.
Comment #82
bnjmnmDiscussing this with @lauriii exposed some core-developer myopia on my part as I'd forgotten about how this impacts custom themes. While most of the rules I added to normalize-fixes should be present in all core themes, it should not be added in a way that forces those rules on custom themes. This also emphasizes the need for a detailed change record. While these rules should not be forced upon themes, it may result in some changes to existing ones and it would be good to detail those.
As part of moving the rules to individual themes, I went through each selector and rule to confirm it was needed and found that many were not. Previously, I'd been copying the entire block of CSS from normalize.css, but quite often only a portion of it was necessary.
I'll go through change-by-change again.
This stays in normalize-fixes. It's fixing an actual bug.
This was necessary in every core theme other than Claro, which always overrides these styles by adding a class in
claro_preprocess_fieldset(), and I did not find instances of a hard coded fieldset (if they exist, then we should see if they are impacted by the regression)This was the trickiest one as the way this was applied in normalize.css 3 was a bug - inherit should not be used. For each theme, I went through each selector to see if a change occurred these rules were disabled. If there was a change, I provided a hard coded line-height/font-size to match what resulted from using
inherit. In some cases, particularly Claro, the normalize css rules were always overridden so those were skippable as well. Each theme only required a small subset of this rule.Umami looks slightly better without these rules added, so I skipped them


With the normalize.css 3.0.3 table CSS
Without it
For the remaining themes, only
border-collapse: collapse;is necessary. The other table/td/tr rules were not added to those themes.Keeping this in normalizes-fixes, with plans to remove in #3114878: The webkit search cancel button should not be hidden . This rule hides search cancel buttons from appearing in the webkit browsers that support them, and this is how core currently functions. However, it is preferred to adopt the perspective of normalize.css and make this element visible, but if this rule is removed, it impacts the search input styling for all themes. In some cases inarguably breaks it. In the followup we can fix those issues in core themes and determine any risks to contrib/custom themes by making this element visible. In the scope of this issue, however, I'd be concerned about exposing an element that has otherwise been hidden for Drupal 8's lifespan.
Comment #83
bnjmnmHere are the patches I meant to include with#82(and this one submitted without my consent so the patches aren't here either.... we will try again)
Comment #84
bnjmnmComment #86
lauriiiI did pretty extensive testing on the patch. I could only find this one regression which affects all themes.
Before:

After:

Comment #87
bnjmnm#86 is due to a rule introduced in normalize.css 4.1.0. Added regression prevention to each theme.
Comment #88
lauriiiUnrelated change 🔬👁
There's still a minor difference on this field. The field is slightly higher which makes the "No file chosen" text unaligned in comparison to the button. This seems to only happen in Seven.
Comment #89
bnjmnmThe should-have-rerolled issue is addressed, but the interdiff doesn't include that.
I found minor differences with the file input on Umami and Bartik as well. I opted to address these as well since the solution is applying less styling overall. Note that In Seven there is a barely (if at all) perceptible difference in line-height by going with this less-styling approach, which I preferred to adding a rule specific to file inputs.
Comment #90
lauriiiThis addressed #88 👍
I found one more regression on IE 11; for some reason there's a bullet next to details elements. This happens in all themes except Claro.

Comment #91
catchBumping to critical since this blocks #3094468: [plan] Update core JavaScript (and CSS) dependencies prior to 9.0.0-beta1 which in turn blocks the beta/release.
Comment #92
bnjmnmThe issue in #90 is due to normalize.css setting all summary elements to
display: list-item. I'd assumed was only a good thing as this was a problem in some Firefox versions. However, for browsers that don't support details/summary, this results in a list item bullet being attached to the element.Note that for this fix several of my attempts to target Edge did not work, including ones that are in use on Claro. I tried:
Until I was finally able to get it to work in my Virtualbox version of edge with
@supports (-ms-ime-align:auto){}Also confirmed that tab navigation and focus still work properly in IE/Edge after this change.
Comment #93
lauriiiConfirmed that this fixes #90 in both, IE Edge and IE 11.
I've now tested Seven, Bartik, Claro and Umami with IE 11, Edge, Firefox, Chrome (MacOS and Android) and Safari (MacOS and iOS) using the Style guide module which should cover most standard HTML element styles. I've also clicked through lots of features in the UI, including node edit form, Umami front-end pages, Bartik front-end pages, status report page, Views UI, layout builder, media library, Field UI and a couple of the configuration forms. I couldn't find any additional regressions.
We've also done some automated regressions testing (#77) which suggested that there aren't any big regressions.
I also confirmed that correct files are loaded from Stable using the non-testing patch.
I'm removing the needs subsystem maintainer review since I believe that it isn't necessary anymore at this point anymore.
I created a draft CR for this since I think it would be good to notify themes not extending Stable or Classy that this might cause regressions in their themes.
Comment #94
xjmGood call on the CR. We should also actually add a release note summarizing the potential disruption. (We'd already be mentioning the dependency major version update anyway, so we can just add a sentence or two to that.)
Comment #95
catchAdded a release note based on the CR.
Comment #96
dyannenovaI ran a quick wraith test on the manual testing patch in #92. I tested Claro and Umami, with a few sample content items at 360px, 768px, and 1280px widths. I've attached the spider yaml file with the tested urls.
The test found some minor changes on these urls:
/filter/tips
/contact/feedback
/contact
/user/login
/user
/user/password
/search
/search/node
I've uploaded the gallery as a zip file with the screenshots and diffs, plus the gallery website with the analysis.
It looks like the relevant rule causing the change for the forms is in the umami base.css file:
/**
* Prevent regression due to explicit line-height applied to these elements in
* normalize.css 7.0.0.
*/
button,
input:not([type="file"]),
textarea {
line-height: 1.5rem;
}
For filter/tips, the rules that used to apply from normalize.css and are now missing are:
table {
border-collapse: collapse;
border-spacing: 0;
}
and
td, th {
padding: 0;
}
Comment #97
lauriiiThank you @DyanneNova! It seems like the differences on tables and form line heights are small enough for them to be ignored, but it's good that they have been now listed here. Does the gallery only list URLs that have differences?
Would you be able to run the test also on Bartik and Seven?
Comment #98
xjmQuestion about the CR. It says:
However, presumably, Stable 9 should use the updated version. Have we explored that yet? The CR should probably clarify that point as well.
Comment #99
xjm@bnjmnm is going to run #97.
Comment #100
bnjmnmThis is happening in Seven ☹️

Comment #101
xjmI wonder if #100 is the same line height difference mentioned in #96?
Comment #102
bnjmnmI rescind my "needs work". Manual testing revealed that my finding in #100 occurs with both versions of normalize. The situation that showed up in the second screenshot, where the "or" is to the right of the select field, occurs (in Chrome at least) in a very specific pixel range 356px-361px. I suspect the 360px specified in wraith may have been interpreted as slightly wider/narrower in the test.
I ran regression tests on Bartik and Seven, using the same paths as the tests in #96. The only differences are related to form input line-heights, which I suspect are acceptable based on #97. It's also not surprising that this would happen, as normalize.css had previously used
line-height: inherit, which means input line heights were not a fixed value throughout the theme. This results in slightly higher line-heights on some admin forms (the values I added were based on keeping entity forms consistent). This difference happens to be closer to what Claro is doing.I attached two comparisons from Bartik. This is exactly what is happening in Seven as well so referencing those is applicable to both themes.
Comment #103
catch#102 looks like a pass on Seven and Bartik, so I think we can restore the RTBC here.
Comment #104
bnjmnmComment #105
alexpottSo i think the issue summary need to make it clear that themes extending from stable & classy are still going to using the old version. I also think the change record needs to detail this and it should detail how (if you not extending stable) you can do the same thing as stable if you are using the normalise library provided by core.
I think the approach here to update the library but continue to use the old one in core themes is a good one and we can deal with more fallout when we remove stable as a base theme for claro, umami, and seven.
Comment #106
bnjmnmComment #107
lauriiiComment #108
lauriiiComment #109
dyannenovaI ran the same Wraith tests on Bartik and Seven and also found a small font size difference in form select fields, introduced by this rule:
select {
font-size: 0.8125rem;
}
Current

New

Difference

The rest of the diffs in the test all appear to be line height related.
Comment #110
dyannenovaSetting back to Needs work.
Comment #111
effulgentsia commentedNice find! I had a hard time spotting that from the full screenshots in #109, so here's just the select field cropped out from each of them. The first/current one is slightly larger than the second/new one.
Comment #112
lauriiiI updated the CR with the info that was requested on #105.
Comment #113
bnjmnmI'll have the font-size issue addressed shortly.
Comment #114
bnjmnmThis addresses #109 and applies similar fixes to Bartik
The location of Stable's normalize-fixes.css was also changed, since Stable's css/core directory already represents /misc. The css/core/misc directory is unnecessary.
Comment #115
lauriiiI think both, #105 and #109 has been addressed. Since this is blocking multiple issues, we should fix rest of the regressions to core themes on #3110855: Plan for removing dependency to Stable in Bartik/Seven/Claro/Umami since they are not visible to users before that issue is committed.
Comment #116
lauriiiJust noticed that the CSS changes cause CSSLint errors:
Comment #117
bnjmnmThat's among the more disappointing ways to realize that PHPStorm lint checking was only set up for my 8.x install.... Fix on the way.
Comment #118
bnjmnmFixed
Comment #119
lauriiiLet's actually revert these changes and add
core/themes/stable/css/core/assets/vendoras ignored path in.stylelintrc.json.Comment #120
bnjmnmAddresses #119 and an extra line in form.css not caught by stylelint autofix
Comment #121
lauriiiThank you! This addresses #116 ✨
Comment #122
alexpottCouple of questions...
As this is going everywhere should it be in the root fixes file?
Should the line-height have units? There's one without - but the other have them. I'm not sure.
Comment #123
bnjmnm#122.1 Regarding the addition of
-webkit-appearance: push-button;to each core theme. We've reserved the root fixes file for actual bugs in normalize.css, The SVG styling in the current normalize-fixes.css addresses a bug -- it reintroduces a rule that shouldn't have removed until IE11 was no longer supported. In the case of-webkit-appearance:it is a worthwhile addition to the library to have available to new themes, despite it needing addressing in each core theme.#122.2 Right, that could look pretty odd without context. The issue being addressed here is that normalize.css 3.0.3 styled these input elements with
line-height: inherit, so the line-height was often determined by the nearest ancestor that specified a value. Different ancestor elements used different (or no) units for line-height.Comment #124
alexpottCredited reviewers - @andrewmacpherson got credit for the first suggestion of using libraries overrides to provide BC, @Cottser and @joelpittet for issue management as theme sub system maintainers back in the day.
Comment #125
alexpott@bnjmnm thanks for answering my questions in #123. I think we're okay to go forward here. Maybe some more things will be found when we decouple core themes from stable but I think we've gone as far as possible to limit the fallout.
Committed 952e939 and pushed to 9.0.x. Thanks!
Comment #127
xjmAdding a link to the CR to the release note (always a best practice).
Comment #129
quietone commentedpublish change record