Follow-up to #1342054: [META] Clean up templates and CSS

Problem/Motivation

  1. Bartik's template files need to be assessed and cleaned up of redundant markup, bad formatting and ID's.
  2. Bartik's CSS files need to follow Drupal's

    ww.drupal.org/node/1886770">CSS Coding Standards.

Proposed resolution

For this issue we take "maintenance-page.css" within Bartik in css/maintenance-page.css plus any template file associated with the CSS and clean them up.

CSS formatting tasks to do

  1. The CSS file needs to use the correct Comment formats - see guidelines here and also reference other fixed Bartik CSS files for wording guidelines.

CSS architecture tasks to do

  1. Replace any ID's with classes within the CSS files and Twig files associated with it - see guidelines here.

CSS cleanup tasks to do

  1. Check all of the selector rules are correct and are currently in use. Fix any broken ones found.

Remaining tasks

  • Write a patch containing as much as the above as possible.
  • Post a patch with screenshots.
  • Visual review of a patch - check the Bartik Maintenance page visually with and without patch applied. Take screenshots.
  • Code review of a patch - check the code follows coding standards, suggest improvements if needed in a comment.
  • Produce a new patch with improvements if needed.

User interface changes

None

API changes

None

Data model changes

None

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because it is refactoring CSS and templates in Bartik
Issue priority Not critical because Bartik functions fine we are just doing cleanup tasks
Unfrozen changes Unfrozen because it only changes CSS and markup
Prioritized changes The main goal of this issue is usability of the Bartik's codebase
Disruption non-Disruptive as it is just changing markup and CSS
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emma.maria’s picture

Title: [META] Overhaul Bartik's code. » Clean up the "maintenance page" component in Bartik
yacinebelarbi’s picture

Issue tags: +Barcelona2015

i'm working at this at drupalcon barcelona sprint. my mentor is jp.stacey. i'm working on a patch as per https://www.drupal.org/contributor-tasks/create-patch

yacinebelarbi’s picture

Status: Active » Needs review
FileSize
1.2 KB

I've added file description and remove an un used selector and changed the page title class and id to follow the format of other templates.

Status: Needs review » Needs work

The last submitted patch, 3: drupal-clean-maintenance-page-2542620-2.patch, failed testing.

simply021’s picture

Status: Needs work » Needs review
FileSize
3.62 KB
581.78 KB

Regarding problem and proposed resolution, i have changed id's into classes and selectors that lean on it. Also reformat css declaration by formating guide.

mgifford’s picture

Issue summary: View changes
FileSize
194.7 KB

Looks like the font is missing.

#header {
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}

Before/After photo

simply021’s picture

@mgifford You are right, mistake by my side, sorry about it.
Fixed in this patch and reduced class for main container.

<div class="main" class="clearfix"> -> <div class="main clearfix">

mgifford’s picture

FileSize
97.89 KB

You don't want a space between I assume:

+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
+
 use \Drupal\Core\Database\Connection;

Are there going to be performance issues with this patch? It's a lot bigger than I expected.

Visually it looks identical now.

simply021’s picture

While creating a patch i have created a mistake.
This one fix it.

mgifford’s picture

So this just removes the space from your previous patch?

I'm really close to RTBC'ing this, but really would like to have someone do a code review given the size of the patch.

simply021’s picture

@mgifford difference between patch #8 and #10 is in merging dev and 8.0.x branch, that's the reason why patch #8 have that size.

emma.maria’s picture

@simply021 can you please upload interdiff files along with patches so we can see the specific changes you have made to the patch. Instructions can be found here: https://www.drupal.org/documentation/git/interdiff

Thanks!

simply021’s picture

Created interdiffs between #6 #8 and #8 #10.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mcjim’s picture

Status: Needs review » Needs work

Thanks for the patch, @simply021. The version in #10 applies and there's no visual difference, so that's really good. (I don't think we need to worry about the interdiffs: the patch in #10 is small and only touches what it needs to.)

While we're here though, I wonder if it's worth having a go at some of the markup, too? I notice that we still have a wrapper div with class main, even though we have a main element, for example. Perhaps there's one or two things like that we could sort out?

simply021’s picture

Assigned: Unassigned » simply021
simply021’s picture

In this patch i'v done following:
-Since there is no site-branding printing variable in maintenance-page.html.twig i have removed in maintenance-page.css 37-51 following for .site-branding-text selector:

.maintenance-page .site-branding-text {
  margin-bottom: 50px;
  margin-left: 0; /* LTR */
  padding-top: 20px;
  font-size: 90%;
}
[dir="rtl"] .maintenance-page .site-branding-text {
  margin-right: 0;
}
.maintenance-page .site-branding-text,
.maintenance-page .site-branding-text a,
.maintenance-page .site-branding-text a:hover,
.maintenance-page .site-branding-text a:focus {
  color: #777;
}

-Converting padding properties for selector [dir="rtl"] .maintenance-page #content .section {
from

padding-left: 0;
padding-right: 10px;

into
padding: 0 10px 0 0;
-Leaving id="header" because inside sites name and site slogan inherit font from
core/themes/bartik/css/components/header.css following:

#header {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

-Should decide how to handle font from selector #header since it still lives inside page.html.twig
my proposal would be to change class selector from .header into .maintenance-header not to overlap with other styles since we have in colors.css

#header {
  background-color: #1d84c3;
  background-image: -webkit-linear-gradient(top, #055a8e 0%, #1d84c3 100%);
  background-image: linear-gradient(to bottom, #055a8e 0%, #1d84c3 100%);
}

-Removing <div class="main clearfix"> ,formating markup and changing selector to maintain style

-Changing id="page-title" into class="page-title" is causing problem because
<h1 class="title" id="page-title"> inherit from
core/themes/bartik/css/components/page-title.css following:

.page-title {
  font-size: 2em;
  line-height: 1em;
}

My proposal would be same as for header to change class selector from #page-title into .maintenance-title

-Reverting usage of selector .header into #header for @media query before it's decided

-Proposal to change css properties for selector .maintenance-page #header
from:

background-color: #fff;
background-image: none;

into:
background: #fff none;

simply021’s picture

Assigned: simply021 » Unassigned
Status: Needs work » Needs review
joginderpc’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +maintenance theme
FileSize
12.89 KB

Tested manually and verified maintenance page working fine as mentioned in comment #18. screen shot attached of test.

screen shot of maintenance page after patch apply.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 18: clean-up-maintenance-2542620-18.patch, failed testing.

joginderpc’s picture

Assigned: Unassigned » joginderpc

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joginderpc’s picture

Status: Needs work » Needs review
joginderpc’s picture

Status: Needs review » Reviewed & tested by the community
lauriii’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/themes/bartik/css/maintenance-page.css
@@ -2,68 +2,52 @@ body.maintenance-page {
+.maintenance-page #content .section {
...
+[dir="rtl"] .maintenance-page #content .section {

Why do we have usage of the #content here?

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Vidushi Mehta’s picture

@lauriii I applied #18 but patch doesn't apply so i rerolled the patch and made the changes.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

sim_1’s picture

Because of the changes made as a part of #3024527: Add and configure stylelint-order, this patch needed to be rerolled by hand (so I can't provide an interdiff).

Using the notes from #18, I included the font family for the .header in the css, otherwise it's overwritten. I also used the #maintenance id so that the background colors from Bartik's main theme don't apply to it.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Project: Drupal core » Bartik
Version: 9.4.x-dev » 1.0.2
Component: Bartik theme » Look and Feel

Since bartik has been removed in D10 moving this ticket over to the contrib module.