Hello,

I see every css libraries declared in the zircon.theme file are displayed like :

@import url("http://..../themes/zircon/css/responsive.css?...");

But actually on the Maintenance page, maintenance-page.css does'nt appear.
I tried to add it for the whole site by adding :

css/maintenance-page.css

in the zircon.theme file, cleared the cache but there was no effet.
I also tried to use a preprocess php file but it seems it does'nt work too.

Can you tell me how can i add the maitenance-page.css to the actual maintenance page ?
Thx.

Issue fork zircon-2651070

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dellartee created an issue. See original summary.

khinxman’s picture

I was able to update the maintenance page css in html.css using the following example:

.maintenance-page .site-slogan {
text-align: left;
}

.maintenance-page h1 {
  background: #075a82;
  color: white;
  margin-top: 100px;
  padding-bottom: 50px;
  padding-top: 50px;
  text-align: center;
}
elakiyasamuel’s picture

Assigned: Unassigned » elakiyasamuel
Status: Active » Needs review
FileSize
871 bytes

1. Create a library for maintenance css in libraries.yml

maintenance-style:
  version: 1.x
  css:
    theme:
      css/maintenance-page.css: {}

2. Use preprocess_maintenance_page hook to set library to the maintenance page.

function zircon_preprocess_maintenance_page(&$variables) {
  $variables['#attached']['library'][] = 'zircon/maintenance-style';
}

Clear cache and run the site, maintenance css will be added only in maintenance page.

elakiyasamuel’s picture

Assigned: elakiyasamuel » Unassigned

Gauravmahlawat made their first commit to this issue’s fork.

Bmuskan’s picture

FileSize
16.21 KB
13.39 KB

At the end of zircon.libraries.yml file, add the below code:

maintenance-style:
    version: 1.x
    css:
        theme:
            css/maintenance-page.css: {}

And now also add the following code at the end of .theme file:

function zircon_preprocess_maintenance_page(&$variables) {
  $variables['#attached']['library'][] = 'zircon/maintenance-style';
}

I have also attached the screenshots of the above code here.

SandeepMahlawat’s picture

FileSize
775 bytes

I have created the patch for the same please review

Shyam_Bhatt’s picture

Status: Needs review » Reviewed & tested by the community

The patch "2651070-7.patch" is working fine.

A new library was added for the maintenance page style.

maintenance-style:
	version: 1.x
	css:
   		theme:
       		css/maintenance-page.css: {}
function zircon_preprocess_maintenance_page(&$variables) {
 	$variables['#attached']['library'][] = 'zircon/maintenance-style';
}
constantsearcher’s picture

Could you please let me know how can I install this patch? I am facing this problem with the Zircon theme.

Thanks!

  • Gauravvv authored f7cfc6ac on 10.1.x
    Issue #2651070 by SandeepMahlawat, Gauravvv: maintenance-page.css does'...
Gauravvvv’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for working on this. Pushed and commited to 10.1.x

Status: Fixed » Closed (fixed)

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