Skip to main content
Oct 16, 2015 2:28 AM UTC
Solved

Adding print media to cq:includeClientLib for CSS file

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.
kautuk_sahni
kautuk_sahniAccepted solution
Level 9
Sep 26, 2016 9:49 AM UTC

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

5 replies

Sep 22, 2016 4:08 PM UTC

I would like to know the same.

Translate
edubey
Level 10
Sep 24, 2016 8:19 AM UTC

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

Translate
smacdonald2008
Level 10
Sep 24, 2016 8:01 PM UTC

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

Translate
kautuk_sahni
kautuk_sahniAccepted solution
Level 9
Sep 26, 2016 9:49 AM UTC

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

Translate
Kautuk Sahni
Adobe Employee
Sep 26, 2016 11:29 PM UTC

+1 to Kautak's solution

Translate