Improve Default Print CSS in all Core themes

Created on 19 November 2016, over 8 years ago
Updated 15 October 2024, 6 months ago

I'd love to see some improvements in the defaults in Core. Partly I'd like to see it look better and I'm interested in reducing paper and wasted by default themes.

Currently we use width: 640px; but this Smashing Magazine article suggests 500px;

We don't define the margins, but it would likely look better:

@page {
  margin: 0.5cm;
}

The Drupal logo just looks bad. I also don't think alert messages should show up in print. We can just set class="messages--status" to "none;".

It would be a good best practice to ensure that the links in the main-content are written out & formatted appropriately:
a:link:after { content: " (" attr(href) ") "; } [/css]
a:link { font-weight: bold; text-decoration: underline; color: #06c; }

There are some other neat ideas here:

Main thing is that I think we can do better here.

Feature request
Status

Needs work

Version

11.0 🔥

Component

Claro theme

Created by

🇨🇦Canada mgifford Ottawa, Ontario

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Pipeline finished with Failed
    6 months ago
    Total: 115s
    #311237
  • Pipeline finished with Success
    6 months ago
    Total: 360s
    #311246
  • 🇮🇳India nayana_mvr

    I have re-rolled the patch D11 incorporating all the style changes from last patch into Claro's print.css and modified some classes as per Claro theme. There are some phpunit file changes in the patch which I don't think is relevant to this ticket, so didn't include that in the re-roll. Had to remove the following code which was mentioned in the description

    @page {
      margin: 0.5cm;
    }
    

    from the MR as it was throwing lint error. Also, I couldn't verify that change in my local i.e., it didn't made any difference to page margin in print mode.
    I have a doubt also reg. this ticket. Don't we need a print style for Olivero theme because that is the default theme that replaced Bartik theme right? Currently I couldn't find any print style file for Olivero. Please let me know if anything needs to be done in Olivero. MR is raised, please review.

Production build 0.71.5 2024