Adding Specialized Elements to Author Mode CSS

Post here questions and problems related to editing and publishing DITA content.
psbentley
Posts: 20
Joined: Mon Aug 04, 2014 5:18 pm

Adding Specialized Elements to Author Mode CSS

Post by psbentley »

Hi there,

I have a few specialized elements that I'd like to show up correctly in Author Mode and I'm having a bit of a hard time getting it to work.

We are using emphasisBold and emphasisItalics instead of <b> and <i>. I've added those to topic.css but they still aren't working correctly. I think part of the problem is that these were both specialized from <ph> rather than <b> and <i>.

Here's what I'm adding to topic.css:

Code: Select all


*[class~="topic/emphasisBold"] {
display:inline;
font-weight: bold;
}
*[class~="topic/emphasisItalics"] {
display:inline;
font-style: italic;
}
Another element I've specialized is already working but that's because it's based on <cite>; it shows up as italics which is exactly what I want it to do. Do you have any suggestions about what I should do to get this to work?

Thanks!!
Peyton
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Adding Specialized Elements to Author Mode CSS

Post by mihaela »

Hi Peyton,

What version of oXygen are you using?

Starting with oXygen version 17 we have added a view called "CSS Inspector" that can help you easily identify the styles that are applied for any element in the document. The matching rules include a link to the line in the CSS file that defines the styles so you can see how the CSS rules were applied and the properties defined. You can use the link to open the associated CSS for editing purposes.
Here are the details about this view:
http://www.oxygenxml.com/doc/versions/1 ... -view.html

Also, starting with version 17, we have improved the rendering of DITA Topics and we have added layered styles so maybe the css file you are editing is not the one that is applied in the current style mode. The best way to check this is to use the CSS Inspector view I have mentioned before.

Another suggestion is to use the !important declaration (it can be used in cascading style sheets to give priority to some parameters).
Maybe the css files contain other properties for the same elements that have precedence.
For example:

Code: Select all


*[class~="topic/emphasisBold"] {
display:inline !important;
font-weight: bold !important;
}
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
psbentley
Posts: 20
Joined: Mon Aug 04, 2014 5:18 pm

Re: Adding Specialized Elements to Author Mode CSS

Post by psbentley »

Hi Mihaela, thanks for the reply.

Unfortunately, I'm using 16.1. I do have access to 17, though; do you think I'd be better off to switch to 17?
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Adding Specialized Elements to Author Mode CSS

Post by mihaela »

Hi Peyton,

Yes, I think you should upgrade to oXygen version 17 since it contains a lot of improvements regarding DITA and CSS (and more).
See here a detailed list of features available starting with 17:
http://oxygenxml.com/xml_editor/whats_new.html


Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Post Reply