It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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;
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

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.

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; 
}

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?

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
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

4,118 views 4 6
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you