Follow-up to #2349711: Remove all visual from stark

Problem/Motivation

Since #2289511: [meta] Results of Drupalcon Austin's Consensus Banana the purpose of the Stark theme has been minimal HTML and CSS, with Classy available as an option for people who want helpful output to work with.

A decision to use Stark as a base theme means you choose to make all these decisions yourself, so Drupal shouldn't be making this decision for users of Stark.

Proposed resolution

Don't load the normalize library for all themes
Load the library in Classy

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task
Issue priority Not critical because because nothing is broken.
Unfrozen changes Unfrozen because it only changes how CSS is loaded.
Prioritized changes The main goal of this issue is to improve themer experience. This is a follow up to a commited change to remove all visuals from Stark, getting default core back to truly being default.
Disruption This change should not be disruptive. Any themes that were expecting normalize, and not using Classy, can simply add the library to their theme.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LewisNyman’s picture

Status: Needs work » Active
yannickoo’s picture

Status: Active » Needs review
FileSize
2.37 KB

I have searched for core/normalize, removed the two occurrences and manually loaded normalize for Classy :)

Status: Needs review » Needs work

The last submitted patch, 2: drupal-normalize_only_for_classy-2472431-1.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: drupal-normalize_only_for_classy-2472431-1.patch, failed testing.

tim.plunkett’s picture

Title: Do not load normalise.css in all themes, load it in Classy » Do not load normalize.css in all themes, load it in Classy
Issue summary: View changes
Manjit.Singh’s picture

@yannickoo I guess no need to remove from theme.inc file

yannickoo’s picture

Status: Needs work » Needs review
FileSize
3.67 KB

Oh, I forgot to fix the test :)

yannickoo’s picture

Re #7: Can you explain me why? I mean it in that place the same libraries as in system_page_attachments should be loaded so when removing from system_page_attachments we should remove it from template_preprocess_maintenance_page as well.

yannickoo’s picture

I have removed the lines which were introdued here.

Status: Needs review » Needs work

The last submitted patch, 10: drupal-normalize_only_for_classy-2472431-10.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Postponed

This patch won't apply until #2349711: Remove all visual from stark is committed

davidhernandez’s picture

This probably ok. We've gone back and forth on how to handle Classy, but realize it will be the best place to put CSS so we can remove it from core modules. Related to all the dream markup efforts.

P.S. Why would anyone use Stark as a base theme? I don't understand the reasoning.

LewisNyman’s picture

Well Stark is the default base theme in a way :)

Status: Postponed » Needs review

Status: Needs review » Needs work

The last submitted patch, 10: drupal-normalize_only_for_classy-2472431-10.patch, failed testing.

davidhernandez’s picture

Component: Stark theme » Classy theme
Status: Needs work » Needs review
FileSize
2.91 KB

The remove all visuals from Stark issue is done. Lets try this again.

davidhernandez’s picture

Issue tags: +Needs change record

We are removing the mandatory inclusion of a library in core, so a change record wouldn't hurt.

cilefen’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
183.72 KB

I just started reviewing with a manual test and found this breaks the Bartik layout:

cilefen’s picture

Seven, also.

davidhernandez’s picture

+++ b/core/themes/classy/classy.info.yml
@@ -7,3 +7,4 @@ core: 8.x
+  - classy/normalize

Oh, duh. That should be core/normalize. I'll fix.

davidhernandez’s picture

Status: Needs work » Needs review
FileSize
2.91 KB
296 bytes
davidhernandez’s picture

Issue summary: View changes

Adding beta evaluation.

Status: Needs review » Needs work

The last submitted patch, 22: do_not_load-2472431-22.patch, failed testing.

davidhernandez’s picture

Issue tags: -Needs change record

Added a draft change record.

davidhernandez’s picture

Status: Needs work » Needs review
FileSize
2.91 KB
1.2 KB
cilefen’s picture

I am confused as to why core/normalize should exist in the context of this issue.

star-szr’s picture

I think because it's a general purpose library it should stay in core so that other themes can use it freely and without possible confusion or dependencies.

davidhernandez’s picture

Yeah, it's a vendor provided asset, but core is what registers it as a library so it is available to all. Themes that don't use Classy may still want to make use of it, but we don't want to force it on them as a default.

cilefen’s picture

Status: Needs review » Reviewed & tested by the community

I am reviewing following the official process:

  • This is a task so there is no problem to reproduce. I read and understood the issue summary.
  • I read the patch. This an easy-to-understand issue and an easy-to-read patch so there is not much to say. The patch does not introduce new coding-style violations.
  • I approach a review like this by searching for the given thing with and without the patch applied. Without the patch:
$ ack 'core/normalize' core/
core/includes/theme.inc
1465:  $variables['#attached']['library'][] = 'core/normalize';

core/modules/system/system.libraries.yml
10:    - core/normalize

core/modules/system/system.module
523:  $page['#attached']['library'][] = 'core/normalize';
  • With the patch:
$ ack 'core/normalize' core/
core/modules/system/src/Tests/Theme/ThemeInfoTest.php
97:    $this->assertEqual(['classy/base', 'core/normalize', 'test_theme/global-styling'], $active_theme->getLibraries());
103:    $this->assertEqual(['classy/base', 'core/normalize', 'test_theme/global-styling', 'core/backbone'], $active_theme->getLibraries());

core/themes/classy/classy.info.yml
10:  - core/normalize
  • I can see from this that 'core/normalize' has been removed from usages in core generally and instead put into the Classy theme as a dependency. I can also see that it is likely no instances were missed. In addition, tests have been updated accordingly, which means this change has some regression test coverage.
  • This is a small patch and it is limited in scope to the intended change.
  • Next, I tested the patch by making a clean install and turning off CSS aggregation. I found that normalize.css is included in Seven, Classy, and Bartik, as expected. It is not loaded in Stark, so the patch works as expected.
  • I manually tested, looking for anomalies like I found in #16 and found none.
  • The draft change record describes this change and makes sense to me.

Based on my findings above, this is ready.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 23df3d5 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

  • alexpott committed 23df3d5 on 8.0.x
    Issue #2472431 by davidhernandez, yannickoo, cilefen, LewisNyman: Do not...

Status: Fixed » Closed (fixed)

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