How to overwrite a style definition?

hans-peter.geier January 4, 2012

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;
background:none;
}

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
Answer accepted
hans-peter.geier January 24, 2012

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
hans-peter.geier January 24, 2012

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)

0 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 4, 2012

You need to be more aggressive with your CSS selectors.

So this should overide things:

body#com-atlassian-confluence, 
#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; 
}

hans-peter.geier January 4, 2012

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 at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 4, 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).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events