How to overwrite a style definition?

I'm trying to add a space style definition for something which is defined in an atlassian stylesheet.

How can I do it?

e.g. the style sheet "splitter.css" (part of the documentation theme) has

body, p, td, table, tr, .bodytext, .stepfield, .wiki-content p, .panelContent{
color: #333;

The "background:none" is causing me some trouble. I found how to create a space style to set background to any other color, but I cannot make this definition uneffective (like "unset" in Linux shell) .

3 answers

1 accepted

0 votes
Accepted answer

I copied the page and stylesheet to my PC and opened it locally. Modified the stylesheet to no longer enforce the background to "none". In this way I got the row highlighting to work correctly.

Though, this is not a soluation, because I do not want to create my own theme for this purpose, nor do I want to modify the Atlassian provided theme.

So I reported this as a bug.

0 votes
David Simpson Community Champion Jan 04, 2012

You need to be more aggressive with your CSS selectors.

So this should overide things:

#com-atlassian-confluence p, 
#com-atlassian-confluence td, 
#com-atlassian-confluence table, 
#com-atlassian-confluence tr, 
#com-atlassian-confluence .bodytext, 
#com-atlassian-confluence .stepfield, 
#com-atlassian-confluence .wiki-content p, 
#com-atlassian-confluence .panelContent {
    color: #000;
    background: hotpink; 

Thanks, David for our quick answer. Actually, I'm able to set any valid color (even without being "more agressive"), but I cannot remove the effect of the existing "background:none" style definition in splitter.css. There are certain macros (e.g. table-plus from famous Bob Swift) which dynamically set "bgcolor" on tr, but the stylesheet's definition of "background:none" has precendence over html and javascript. Setting background to any color (including "none") turns other attempts to set the bgcolor off. I hacked to comment off the "background:none" line which then had the desired effect, but this is not what I want to do in production.

I just found another question (how-do-i-override-css-styles-in-the-documentation-theme) , where the answer was given to modify or clone the document theme and do what the requestor wanted to do (which is de jure a new theme), but this is not really what I want to do, as I would no longer get Atlassian's support.

I don't know whether there is a way to undefine an existing style attribute?

Maybe I should raise an issue against the Document Theme, if I can't fix this myself?

David Simpson Community Champion Jan 04, 2012

You won't be able to "unset" just that rule yourself with an override.

The only way of doing it would then be to reapply all the other styles again. This is surely more horrid than hacking the theme jar.

Raising an issue could be the answer. If you hack the Documentation Theme, be sure to increment the version element in the pom.xml, otherwise the changes may not be noticed (because it's a bundled plugin).

I have opened a JIRA issue: ANSWERS-436

though it may be in the wrong queue. Hopefully someone moves it to the appropriate place. (project)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

72 views 3 3
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