workaround to CSS @counter-style
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 25
- Joined: Thu Aug 07, 2014 3:40 pm
workaround to CSS @counter-style
Post by Bruno.Ballarin »
I am under the impression that the rule @counter-style is not supported (yet?) in dita framework CSSs.
I understand this rule would allow (when supported) to modify the rendering of a counter from the default numeric suite 0 1 2 ... to (for instance) a literal suite A B C.
Would there be a workaround to this feature like for instance being able to test the value of a counter and use the result of the test to render one or another hard coded character. For prefixing appendix titles for instance I would only need A B and C since we likely not have more than 3 appendix main sections.
Cheers,
Bruno
I understand this rule would allow (when supported) to modify the rendering of a counter from the default numeric suite 0 1 2 ... to (for instance) a literal suite A B C.
Would there be a workaround to this feature like for instance being able to test the value of a counter and use the result of the test to render one or another hard coded character. For prefixing appendix titles for instance I would only need A B and C since we likely not have more than 3 appendix main sections.
Cheers,
Bruno
-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: workaround to CSS @counter-style
Hi Bruno,
I'm not sure exactly what your CSS looks like.
A possible solution is something like:
Regards,
Radu
I'm not sure exactly what your CSS looks like.
A possible solution is something like:
Code: Select all
:root{
counter-reset:appendixCounter;
}
appendix {
counter-increment:appendixCounter;
}
appendix title:before {
content:"Appendix " counter(appendixCounter, upper-alpha) ": ";
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 25
- Joined: Thu Aug 07, 2014 3:40 pm
Re: workaround to CSS @counter-style
Post by Bruno.Ballarin »
Thank you very much Radu.
It does precisely what I was looking for
.
Cheers,
Bruno
It does precisely what I was looking for

Cheers,
Bruno
-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: workaround to CSS @counter-style
Hi Bruno,
Thanks for the confirmation. We'll probably add a similar improvement to the CSSs bundled by default in Oxygen for DocBook editing support.
Regards,
Radu
Thanks for the confirmation. We'll probably add a similar improvement to the CSSs bundled by default in Oxygen for DocBook editing support.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service