How do you manage your PDF Export stylesheets?

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
Accepted answer

Hello Felicity,

I filed the following bug a while ago.

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.

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.

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.

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

743 views 33 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you