Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do you manage your PDF Export stylesheets?

Felicity Chapman February 13, 2013

I need to customize the PDF export stylesheet for some spaces. Some of the spaces need the same customization, others need different customizations.

I'm finding it really hard to keep track of what's different from the global stylesheet in which space.

Ideally, I'd define all of the common CSS in the global stylesheet and then just add the few space customizations to the CSS in each space. However, Confluence doesn't seem to work like this. It seems that if there is a space CSS then this CSS is used, falling back to the Confluence default CSS for anything that's not included. If there is no space CSS defined at all for PDF Export then the Global CSS is used, falling back to the Confluence default CSS.

It would be much easier to maintain if any space CSS took highest precedence, followed by global CSS and then falling back on the default CSS only if there's no space or global definition.

How do you manage your CSS? any thoughts?

2 answers

1 accepted

1 vote
Answer accepted
Daniel Borcherding
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 14, 2013

Hello Felicity,

I filed the following bug a while ago.

https://jira.atlassian.com/browse/CONF-27929

It appears as if using a Space CSS will cause Confluence to completely ignore any Global CSS.

You rightly point out that styles do not cascade as they are supposed to. Please feel free to add you own comments to that ticket. I will attach this post to the issue to further increase it's visibility.

Felicity Chapman February 14, 2013

Thanks for alerting me to your Jira issue. I've voted for it. It's frustrating that such a small omission makes the task of maintaining stylesheets so much harder.

1 vote
RianA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2013

By right the Space CSS should be on the first priority, however if it's not the case, perhaps you could add !important tag before the end of the semi colon. This tag will be the first priority wherever it's placed. You can get more information on this documentation.

Felicity Chapman February 13, 2013

Thanks for the quick response. Sorry. I obviously didn't explain very well.

Yes, the Space CSS takes precedence and then the export falls back to the Default CSS.

I think that itthe PDF export should try Space CSS, then the Global CSS before falling back to the Default CSS. It would allow you to put all common CSS elements in the Global CSS and just maintain any space quirks in the Space CSS.

Like Laura Schneider likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events