1

What is the right or omega way of integrating print styles in omega 4?

I've found no references in the docs.

1

Omega 4 layout styles are loaded last, even after print styles added via the theme's .info file. The only catch-all solution that I'm aware of is to an @media rule to your styles. If you need to override a layout's styles you'll need to add an @media rule there too.

If you're not using Omega 4 layouts then adding your print styles via the theme's .info file will work - just be aware that this will add an additional stylesheet request and so isn't the most performant option, especially considering how minimal print styles can often be. The @media solution wins on all fronts here IMHO.

1

Like for any css file, add it into the theme's info file, but rather than 'all', just specify it to be only for print.

stylesheets[all][] = css/everytime.css
stylesheets[screen][] = css/screen-only.css
stylesheets[print][] = css/print-only.css
4
  • So it's the same as any other theme? I thought omega might handle that part in its own way, like they do with preprocess functions and so on. – Linus Aug 5 '14 at 11:18
  • It's not the theme that handle them. Drupal just include them in every page. – Astrayus Aug 5 '14 at 11:25
  • Yeah, but as this is all based on sass, I thought there might be some boilerplate like they did with omega.hacks.scss, omega.no-query.scss and so on. – Linus Aug 5 '14 at 12:19
  • 1
    This won't work if you're using Omega 4 layouts and need to override a layout style in your print styles. See my answer below for a truly catch-all solution. – danbohea Apr 15 '15 at 10:13
0

Just add this to the OMEGASUBTHEME.hacks.scss

@media print {

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.