Answers.Body: <p>I think you can use <a href="https://docs.civicrm.org/dev/en/latest/framework/resources/#css-stylesheets" rel="nofollow noreferrer">addStyle or addStyleUrl or addStyleFile methods</a></p>
  <p>eg:</p>
  <pre><code>function extensionname_civicrm_config(&amp;$config) {
    if (!empty($_REQUEST['snippet']) &amp;&amp; $_REQUEST['snippet'] == 2) {
      Civi::resources()-&gt;addStyle('.label {     
        font-style: italic;
        font-weight: bold;
        font-size: 20px;
      }');
    }
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-03T10:47:01.123Z
Answers.LastActivityDate: 2021-06-03T10:47:01.123Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>This is referencing a Drupal 7 website with CiviCRM 5.36.x</p>
  <p>When CiviCRM prints from a modal it invokes print.css which lives in /sites/all/modules/civicrm/css/. It does not invoke any other theme level css or the custom css that can be set in Administer/System Settings/Resource URLs.</p>
  <p>In the case I'm working on, I have attached custom fieldsets to my membership types and applicants can apply via a webform to include a great deal of data.</p>
  <p>If I view a membership from a contact record and print, the OEM print.css is invoked and the printed result or PDF is useless. To overcome this shortcoming, I've modified print.css but I'm looking for a long-term sustainable solution.</p>
  <p>How does one override print.css with custom css?</p>
  <p>Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-03T00:32:21.667Z
Comments.Text: Maybe not exactly what you're asking but if you turn off popups at Administer -  Customize - Display Prefs then that would get around it?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-03T08:09:54.190Z
Comments.Text: Are your changes to print.css useful to others?  How about creating a PR? Looks like that file has not had any attention for a long time.
Comments.UserDisplayName: Aidan
Tags: <css><drupal-7>
Title: How does one override print.css (Drupal 7 / CiviCRM 5.36.x)
ThreadText: # How does one override print.css (Drupal 7 / CiviCRM 5.36.x)
  
  (Asked by: username_0 on 2021-06-02)
  
  This is referencing a Drupal 7 website with CiviCRM 5.36.x
  
  When CiviCRM prints from a modal it invokes print.css which lives in /sites/all/modules/civicrm/css/. It does not invoke any other theme level css or the custom css that can be set in Administer/System Settings/Resource URLs.
  
  In the case I'm working on, I have attached custom fieldsets to my membership types and applicants can apply via a webform to include a great deal of data.
  
  If I view a membership from a contact record and print, the OEM print.css is invoked and the printed result or PDF is useless. To overcome this shortcoming, I've modified print.css but I'm looking for a long-term sustainable solution.
  
  How does one override print.css with custom css?
  
  Thanks.
  
  **Tags:** css, drupal-7
  
  > **Comments:**
  > **username_1**: Maybe not exactly what you're asking but if you turn off popups at Administer -  Customize - Display Prefs then that would get around it?  
  > **username_2**: Are your changes to print.css useful to others?  How about creating a PR? Looks like that file has not had any attention for a long time.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2021-06-03. Score: 1
  
  I think you can use addStyle or addStyleUrl or addStyleFile methods
  eg:
  function extensionname_civicrm_config(&$config) {
    if (!empty($_REQUEST['snippet']) && $_REQUEST['snippet'] == 2) {
      Civi::resources()->addStyle('.label {     
        font-style: italic;
        font-weight: bold;
        font-size: 20px;
      }');
    }
  }
  
  
  ---
  
  