Adding print media to cq:includeClientLib for CSS file | Community
Skip to main content
New Participant
October 16, 2015
Solved

Adding print media to cq:includeClientLib for CSS file

  • October 16, 2015
  • 5 replies
  • 2327 views

Hi,

Is it possible to add the print media to the CSS clientlib include in anyway.

<link rel="stylesheet" type="text/css" href="print.css" media="print">

I don't want to call the print css file separately, I want to add it through cq:includeClientLib only.

Thanks,

Bala

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi 

As mentioned by Praveen and Scott, we could not add it directly.

You need to add it separate CSS file or existing file like:-

@media not|only mediatype and (expressions) {
    CSS-Code;
}

is same as

<link rel="stylesheet" media="mediatype and|not|only (expressions)" href="print.css">

 

I hope this would help you.

~kautuk

5 replies

Employee
September 26, 2016

+1 to Kautak's solution

kautuk_sahni
kautuk_sahniAccepted solution
Employee
September 26, 2016

Hi 

As mentioned by Praveen and Scott, we could not add it directly.

You need to add it separate CSS file or existing file like:-

@media not|only mediatype and (expressions) {
    CSS-Code;
}

is same as

<link rel="stylesheet" media="mediatype and|not|only (expressions)" href="print.css">

 

I hope this would help you.

~kautuk

Kautuk Sahni
smacdonald2008
New Participant
September 24, 2016

Agreed with Praveen - load that CSS into a separate ClientLib and call when needed. 

edubey
New Participant
September 24, 2016

I dont think cq:includeClientLib will help you to included print CSSas there is not separate parameter for this. The whole purpose of this is to include your client libs categories. May be you can create a client lib which has only print css and load it based on template

New Participant
September 22, 2016

I would like to know the same.