Problem/Motivation

After #3115223: Remove Stable as a base theme of core themes, core themes will not depend on Stable. They will instead inherit templates and CSS directly from core.
Before this happens, we need to identify any problems/regressions this change might cause and address them before this change is implemented.

Proposed resolution

Create a test that identifies which assets are different in Stable and core, and determines which of those are loaded by each core theme.

For each of these assets identified as different, evaluate how they will impact core themes.

If they would cause an unwanted change, then that change should be mitigated in the impacted core theme.

In the test, each differing asset that is not already overridden by the core theme can be added to a skip list. Each skip list item should be accompanied by an explanation as to why it is OK to skip them.

Note that automated regression testing does not have to occur within this issue, as it is only accurate with a combination of several other issues patches. Testing that includes the changes from this issue has occurred in #3115223: Remove Stable as a base theme of core themes, and the change here (to container-inline) successfully mitigated regressions.

Remaining tasks

Write the test to identify assets that require evaluation
Evaluate each asset, determine which require mitigation only container-inline needs addressing
Run regression tests in #3115223: Remove Stable as a base theme of core themes that include the patches from this issue

User interface changes

Not in the scope of this issue, as core themes continue to depend on Stable.

API changes

Data model changes

Release notes snippet

Comments

bnjmnm created an issue. See original summary.

bnjmnm’s picture

Title: Create test for determining if theme assets will work properly without Stable » Create test theme asset decoupling from Stable
Assigned: bnjmnm » Unassigned
Priority: Minor » Major
Status: Active » Needs review
StatusFileSize
new10.12 KB
bnjmnm’s picture

Title: Create test theme asset decoupling from Stable » Create test for theme asset decoupling from Stable
gábor hojtsy’s picture

bnjmnm’s picture

Status: Needs review » Active
StatusFileSize
new86.75 KB
new72.13 KB
new94.56 KB
new97.72 KB
new80.2 KB
new72.78 KB
new79.83 KB
new78.87 KB

This is the first of several comments reviewing how a single asset is used by each core theme.

block.admin.css

Impacts: Claro, Bartik, Seven, Umami
What is different: adds this rule

.block-disabled:not(:hover) {
  opacity: 0.675;
  background: #fcfcfa;
}

Which makes disabled blocks semi-transparent.

Claro

Using stable

Using core


The contrast meets AAA - 5.29:1.

Seven

Using stable

Using core


The contrast meets AA - 4.6:1

Bartik

Using stable

Using core


👿 Contrast is not accessible - 4.15:1

Umami

Using stable

Using core


👿Contrast is not accessible - 3.82:1

bnjmnm’s picture

filter.caption.css

Impacts: Claro, Bartik, Umami, Seven
What is different: Stable adds this rule:

/* Undo margin added to figure in core/assets/vendor/normalize-css/normalize.css */
figure.caption-drupal-media.align-center {
  margin-right: auto;
  margin-left: auto;
}

This rule is unnecessary once #2821525: Update normalize.css to the most recent version lands, so this will not need to be changed unless the Normalize.css issue has a surprise block.

bnjmnm’s picture

progress.module.css

Impacts: None
What is different in core vs. stable:

  .progress__bar {
     width: 3%;
     min-width: 3%;
-   height: 1.5em;
+  height: 16px;
    background-color: #000;
  }

No core themes are impacted as each have their own stylesheets that specify height for .progress__bar

bnjmnm’s picture

system-modules-details.html.twig, system-modules-uninstall.html.twig

Impacts: none
What is different in core vs. stable:
An unnecessary data-striping attribute is removed in the core version, which happened in #2923305: Module (un-)install tables have a useless "data-striping" attribute

bnjmnm’s picture

views-ui-views-listing-table.html.twig

Impacts: Umami, Seven, Bartik
What is different in core vs. stable:
Core implements the fix in #3059872: View names on view list table shouldn't be headings, which changes an <h3> that shouldn't be a heading to be wrapped in <strong> instead.
This is an acceptable/welcome change so this asset can be inherited from core.

bnjmnm’s picture

StatusFileSize
new154.3 KB
new102.49 KB
new26.6 KB

container-inline.module.css

Impacts: Bartik, Umami
What is different in core vs. stable: .container-inline div, .container-inline label changed from display: inline; in stable to display: inline-block;
Changed in #2226317: Divs in the container-inline wrapper should be inline-block instead of inline

Umami

👿Regression 👿Tested with datetime input as that is one of the more likely elements to appear in non-admin context. There may be additional regressions but just this demonstrates that Umami can't inherit this style from core.

Bartik

👿Regression 👿
Datetime results in extra margin

Search input takes submit and input out of alignment

bnjmnm’s picture

install-page.html.twig

Impacts: Bartik, Umami
What is different in core vs. stable: Core has the change implemented in #2528420: Two H1's in Installation Process, which addresses multiple <h1> elements on the install page. It is fine for Bartik and Umami to inherit this fix.

bnjmnm’s picture

status-report-counter.html.twig

Impacts: Umami, Bartik
What is different in core vs. stable:
Core adds classes and icons

-{{ amount }} {{ text }}
+<span class="system-status-counter__status-icon system-status-counter__status-icon--{{ severity }}"></span>
+<span>{{ amount }} {{ text }}</span>
 <a href="#{{ severity }}"><span class="visually-hidden">{{ text }} </span>Details</a>

Bartik

From Stable

From Core

Umami

From Stable

From Core

In both Umami and Bartik, the only difference is the text is moved slightly to the right to make space for theoretical icons. In my opinion this is an acceptable change as 1) the text wasn't perfectly centered in the first place 2) This is a small change that doesn't "break" anything, and it appears on an admin element on a non-admin theme so it's very unlikely the template would ever appear in those themes.

bnjmnm’s picture

status-report-general-info.html.twig

Impacts: Umami, Bartik
What is different in core vs. stable: A single char of whitespace
<h4>{{ 'Version'|t }}</h4> {{ php.value }}
VS
<h4>{{ 'Version'|t }}</h4>{{ php.value }}

This is an acceptable change. It does not impact functionality and would have been a good candidate for the scope of #3111729: Stable templates/CSS that differ only in comments or indentation should match core's version.

bnjmnm’s picture

system-status-counter.html.twig

Impacts: Bartik, Umami
What is different in core vs. stable:
Changes to icons
.system-status-counter__status-icon:before {
display: block;
+ width: 100%;
+ height: 100%;
content: "";
background-repeat: no-repeat;
background-position: center 2px;
- background-size: 20px;
+ background-size: 16px;
}
Expanding on the conclusion made for status-report-counter.html.twig in #12, inheriting from core should be acceptable. The only change is width/height/background-size of an element that doesn't appear in these themes.

bnjmnm’s picture

Version: 8.9.x-dev » 9.0.x-dev
Related issues: +#3115710: Investigate changing container-inline rules in Umami
bnjmnm’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new6.77 KB
new11.89 KB

Based on reviewing each asset that differs in core / stable, I've sorted them into 4 piles:

Additional work definitely needed

Additional work maybe needed

  • block.admin.css #5 (evaluation). Insufficient contrast in Bartik and Umami. However, it is unlikely that these themes would display the Block admin UI as these are not admin themes. Would like additional input on whether this is acceptable or not.
  • status-report-counter.html.twig #12 (evaluation) The evaluation documents why I think it's OK to let the core themes inherit this template from core (particularly since it's an admin template in a non-admin theme) , but the changes that do occur are just enough to warrant getting additional opinions.
  • system-status-counter.html.twig #14 (evaluation) Only necessary if it is decided that status-report-counter.html.twig (the above item) can't be inherited from core by Bartik/Umami

No work needed

Need additional info

  • status-report.html.twigWasn't sure how to get this to appear during manual testing - it looks like I may need to spoof an insufficient requirement but I figure it's more effective to see if another contributor can assist with this vs spending too much time in that rabbit hole.

Based on the above, the current patch updates the test with explanations for each skipped assets. For those definitely/potentially requiring additional work, the comment is to the right of the asset instead of above (intentionally breaking CS so they're easily spotted in PHPStorm. There's still a bit to do, but setting to Needs Review as a review would be good before proceeding with the next steps.

bnjmnm’s picture

StatusFileSize
new6.34 KB
new14.14 KB

Discussed this with @lauriii and we determined that only one asset needs to be addressed: container-inline.module.css. Inheriting container-inline.module.css from core would result in unpleasant regressions in Umami and Bartik (see #10). This patch includes theme-specific regressions for those regressions. A followup for Umami was created - to see if there are benefits in refactoring to inherit from core: #3115710: Investigate changing container-inline rules in Umami. Bartik is not getting a followup as Olivero will be taking its place.

The other items I was unsure about in #16 were judged as not needing to be addressed:

  • block.admin.css is admin styling and the only issues were occurring in non admin themes. In addition, it was determined that this approach should probably change, which is detailed in the followup: #3116003: UX issue with disabled blocks in block admin UI.
  • status-report-counter.html.twig + system-status-counter.css: the changes are only present in non-admin themes, and do not "break" anything
  • status-report.html.twig: we could not find any evidence that this is used by core themes

So this is now ready for a full review, this will cover the test and ensuring core themes can stop depending on Stable with no template or CSS issues.

bnjmnm’s picture

Title: Create test for theme asset decoupling from Stable » Create test for theme asset decoupling from Stable and address any regressions that decoupling may cause
Issue summary: View changes
lauriii’s picture

  1. +++ b/core/tests/Drupal/KernelTests/Core/Theme/StableDecoupledTest.php
    @@ -0,0 +1,286 @@
    +  public function assetsThatDifferInStable() {
    

    Nit 🔬👁: Shouldn't this function be protected?

  2. +++ b/core/tests/Drupal/KernelTests/Core/Theme/StableDecoupledTest.php
    @@ -0,0 +1,286 @@
    +    $in_stable_only = array_diff(array_keys($stable_assets), array_keys($core_assets));
    

    If something exists only in Stable, shouldn't it be taken into account because it would be missing after Stable is not used as a base theme anymore?

bnjmnm’s picture

StatusFileSize
new14.58 KB
new2.01 KB

#19.1 done.
#19.2 Right, my original plan was to address these independently - they were mentioned in #3110855: Plan for removing dependency to Stable in Bartik/Seven/Claro/Umami but a child issue wasn't yet created. Turns out it is much less complex than expected and actually in-scope here.
Both are files that were removed from core. The Stable versions would only be loaded via libraries-override: in Stable:, but since those files don't exist, there's nothing for Stable to replace.

file/drupal.file:
    css:
      theme:
        css/file.admin.css: css/file/file.admin.css
filter/drupal.filter:
    css:
      theme:
        css/filter.admin.css: css/filter/filter.admin.css

I updated the test with a comment that summarizes why this (and a template from the now-removed Simpletest) are skipped.

lauriii’s picture

Status: Needs review » Needs work
+++ b/core/tests/Drupal/KernelTests/Core/Theme/StableDecoupledTest.php
@@ -0,0 +1,294 @@
+          // The only difference is to address an issue with normalize.css that
+          // has since been fixed.
+          'filter.caption.css',
...
+          // The only difference is to address an issue with normalize.css that
+          // has been fixed.
+          'filter.caption.css',
...
+          // The only difference is to address an issue with normalize.css that
+          // has been fixed.
+          'filter.caption.css',
...
+          // The only difference is to address an issue with normalize.css that
+          // has since been fixed.
+          'filter.caption.css',

Could we add a reference to the normalize.css issue since it hasn't been committed yet?

bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new2.82 KB
new14.88 KB

Good call on #21, I added comments to reflect this, and phrased it so it works with either commit status.

It's also a good cue to explicitly state that This issue should not be committed until #2821525: Update normalize.css to the most recent version is committed since it assumes that the fix provided by the normalize.css update is present.

bnjmnm’s picture

You can see results of Wraith regression testing here: #3115223: Remove Stable as a base theme of core themes. This test includes the patch from #22, plus a patch from #3117217: Decouple core theme dependency on functions in stable.theme, Without all three of those being tested at once some regressions would be unavoidable, and it would be difficult to distinguish which ones were expected vs. which ones were a problem.

The results of the testing are encouraging, the only regression spotted was expected due to the Views list change detailed in #9 that we decided was acceptable.

xjm’s picture

Issue tags: +beta target

It's somewhat borderline, but there's a possibility we could allow this issue during beta, since theoretically it is not disruptive (and even if it were, it'd be disrupting an internal API). Ideally we would still have it done before beta1 so that any accidental regressions are present as soon as folks start testing the beta, but it's less important than actually adding Stable 9.

lauriii’s picture

Title: Create test for theme asset decoupling from Stable and address any regressions that decoupling may cause » [PP-1] Create test for theme asset decoupling from Stable and address any regressions that decoupling may cause
bnjmnm’s picture

Title: [PP-1] Create test for theme asset decoupling from Stable and address any regressions that decoupling may cause » Create test for theme asset decoupling from Stable and address any regressions that decoupling may cause

#2821525: Update normalize.css to the most recent version landed so this is no longer postponed.

bnjmnm’s picture

Issue summary: View changes
lauriii’s picture

Status: Needs review » Reviewed & tested by the community

There's a great summary of all the changes in #16.

The fix for the container-inline change is correct and there's a follow-up to see if the fix should be improved in future. Something that caught my eye while checking this was a rule with selector .container-inline .details-wrapper which is overriding the .container-inline rules for details wrapper. Even though after this change .container-inline rules are placed after the override, the override will take place because of its weight.

Based on all of this, I think we are ready on this issue. Even though we are not expecting any side effects, we're planning to do regression testing as part of [# #3115223] which will help us catch any unexpected side effects that this might have.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 22: 3113211-22.patch, failed testing. View results

bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new15.17 KB
new1.68 KB

The test needed to be updated to account for normalize.css being added to Stable - something that happened earlier today.

bnjmnm’s picture

StatusFileSize
new1.38 KB
new15.14 KB

Spotted a few nits in #30 moments after the testbot started.

bnjmnm’s picture

StatusFileSize
new770 bytes
new15.1 KB

Another nit.

Status: Needs review » Needs work

The last submitted patch, 32: 3113211-32.patch, failed testing. View results

bnjmnm’s picture

Status: Needs work » Needs review

Unrelated test failure, switching back to NR.
On the plus side, QuickeditIntegrationTest is taking some of the heat away from Media Library!

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

+1 to all of the changes. 😁

Gave the patch another read and it looks good to go.

  • Gábor Hojtsy committed e8a6b79 on 9.0.x
    Issue #3113211 by bnjmnm, lauriii, xjm: Create test for theme asset...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Yay thanks both!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.