Is it possible add CSS at runtime?
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
Is it possible add CSS at runtime?
Post by manojdcoder »
I noticed DITA and DocBook defines CSS for built-in profiling attributes, for example following is the CSS from DITA for audience
I have a dynamic list of profiling attributes for which I like to add similar CSS. Is it possible to inject CSS into editor at runtime using plugin, perhaps right before loading the document?
Code: Select all
*[audience] {
border: 1px solid green;
}
*[audience]:after(1000003) {
font-size: 0.75em;
content: ' (if audience is ' oxy_label(text, oxy_concat("'", oxy_replace(attr(audience), ' ', "' or '"), "'"), color, #0000ff) ') ';
background-color: #CCFFAA;
}
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Is it possible add CSS at runtime?
Post by cristi_talau »
Hello,
Web Author supports custom DITA profiling attributes by default. The DITA specialization has to declare them using the domains attribute of the root element. This attribute should contain:
where ATTR is the name of the custom profiling attribute.
A more flexible option is to use the StylesFilter API [1].
Depending on your use-case, using psuedo-classes [2] can also be an option.
Best,
Cristian
[1] https://www.oxygenxml.com/InstData/Edit ... ilter.html
[2] https://www.oxygenxml.com/doc/versions/ ... asses.html
Web Author supports custom DITA profiling attributes by default. The DITA specialization has to declare them using the domains attribute of the root element. This attribute should contain:
Code: Select all
a(props ATTR)
A more flexible option is to use the StylesFilter API [1].
Depending on your use-case, using psuedo-classes [2] can also be an option.
Best,
Cristian
[1] https://www.oxygenxml.com/InstData/Edit ... ilter.html
[2] https://www.oxygenxml.com/doc/versions/ ... asses.html
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