Purpose of the static.css file? | Community
Skip to main content
Community_Admin
Adobe Employee
Adobe Employee
October 16, 2015
Solved

Purpose of the static.css file?

  • October 16, 2015
  • 1 reply
  • 925 views

Hello,

 

I'm trying to get to know how designs work in CQ5.

I've noticed that if I have CSS files in the clientlibs folder which has a categories property set in a design then I can include these CSS files by calling <cq:includeClientLib categories="category_name" /> in the head.jsp of my page component.

 

Example:

/etc

     /designs

          /demo

               /clientlibs     (categories = "demo")

                    /css

                         /style.css

                    /css.txt

 

Now if I copy the design and change some CSS settings then both clientlibs folders are included, because both have "demo" as the value of the categories property.

 

Generated HTML-code:

<link rel="stylesheet" href="/etc/designs/demo 2/clientlibs.css" type="text/css">

<link rel="stylesheet" href="/etc/designs/demo/clientlibs.css" type="text/css">

 

This is a problem if I want a website where the author can choose a design over the page properties.

While examining the Geometrixx project I noticed that "static.css" is being used for designs.

Unfortunately I was not able to find a description about what purpose "static.css" is supposed to have in CQ5.


What I would like to know:

What's the puprose of static.css?

Is the static.css file used in CQ5 for other things than just page styling?

Are there any 'best practices' I should look into?

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 Community_Admin

Here's a small update for those who want to keep their CSS files in the 'clientlibs' folder:

 

If there are different designes available for a website, then you can use the design's name as the 'categories' value and in your head.jsp retrieve the current design and use the name (ID) in the <cq:includeClientLib > line.

 

Code:

<cq:includeClientLib categories="<%= currentDesign.getId() %>" />

1 reply

Community_Admin
Adobe Employee
Community_AdminAdobe EmployeeAuthorAccepted solution
Adobe Employee
October 16, 2015

Here's a small update for those who want to keep their CSS files in the 'clientlibs' folder:

 

If there are different designes available for a website, then you can use the design's name as the 'categories' value and in your head.jsp retrieve the current design and use the name (ID) in the <cq:includeClientLib > line.

 

Code:

<cq:includeClientLib categories="<%= currentDesign.getId() %>" />