CSS selector for folded element
Oxygen general issues.
-
- Posts: 26
- Joined: Wed Jun 26, 2013 1:08 am
CSS selector for folded element
Post by avanlooveren »
I have a custom document type and would like to have foldable element display one thing when folded (I'm using -oxy-not-foldable-child for this) and something else when expanded. Here's an example:
[When section 1 folded]
[When section 1 expanded]
It seems the default behavior when no -oxy-not-foldable-child and no :before selector content property are specified, the element local name is displayed when the element is folded. I would like to tap into that same behavior.
-Andre
[When section 1 folded]
Code: Select all
Section 1: Title for Section 1
Section 2: Title for Section 2
Code: Select all
Section 1
Title: Title for Section 1
Author: Andre
...
Section 2: Title for Section 2
-Andre
-
- Posts: 9438
- Joined: Fri Jul 09, 2004 5:18 pm
Re: CSS selector for folded element
Hi Andre,
So:
and the section number we display as a :before element on the title something like:
The entire CSS is here if you need some inspiration:
OXYGEN_INSTALL_DIR\frameworks\docbook\css\elements.css
So the point would be that we display the section static content ("Section X") on the :before of the <title> located inside the section.
Regards,
Radu
So:
You are correct.It seems the default behavior when no -oxy-not-foldable-child and no :before selector content property are specified, the element local name is displayed when the element is folded.
We have this implemented in CSS for Docbook XML documents. So we have this CSS selector to specify the non-foldable child:I would like to tap into that same behavior.
Code: Select all
section{
-oxy-foldable:true;
-oxy-not-foldable-child: title;
}
Code: Select all
section > title:before
{
content: "Section " counter(sect1_count, decimal) ": ";
}
OXYGEN_INSTALL_DIR\frameworks\docbook\css\elements.css
So the point would be that we display the section static content ("Section X") on the :before of the <title> located inside the section.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 26
- Joined: Wed Jun 26, 2013 1:08 am
Re: CSS selector for folded element
Post by avanlooveren »
Thank you, Radu. I moved my section numbering to the title element, like the Docbook framework, but the result is the same as what I had previously. I think that I did not properly describe what I'm looking for. The key thing is a different display of the non-foldable child element when the parent is folded and when it is not.
When the title is shown in the folded section, only the title's contents are to be shown, preceded by the section numbering (counter) and a colon (:). When the section is expanded (unfolded), the section numbering stays (section:before content), the colon disappears, and the title goes to a separate line (display:block) accompanied by a label ("Title: "). I hope that is clearer.
You confirmed the behavior of "the element local name is displayed when the element is folded". Is that something I can access by pseudo-class? Something like? Alternatives could be a pair of selectors like
and
or
and .
When the title is shown in the folded section, only the title's contents are to be shown, preceded by the section numbering (counter) and a colon (:). When the section is expanded (unfolded), the section numbering stays (section:before content), the colon disappears, and the title goes to a separate line (display:block) accompanied by a label ("Title: "). I hope that is clearer.
You confirmed the behavior of "the element local name is displayed when the element is folded". Is that something I can access by pseudo-class? Something like
Code: Select all
section:folded { content: "Section: " counter(sectCtr);}
Code: Select all
section:folded:before
Code: Select all
section:unfolded:before
Code: Select all
title:foldedParent:before
Code: Select all
title:unfoldedParent:before
-
- Posts: 9438
- Joined: Fri Jul 09, 2004 5:18 pm
Re: CSS selector for folded element
Hi,
I understand, we have some future plans to add support for a special peudo class allowing you to match folded elements just as you exemplified. I will try to increase the issue's priority.
One workaround for you would be to implement on your own the folding mechanism without using Oxygen's CSS support for creating folds.
Using Oxygen's support for form controls you can add small expand/collapse buttons which when pressed can set a certain pseudo class on the current element. Based on that pseudo-class you can match in the CSS elements and assign various styles to them.
You can find some useful links on this previous forum post:
topic12842.html
Regards,
Radu
I understand, we have some future plans to add support for a special peudo class allowing you to match folded elements just as you exemplified. I will try to increase the issue's priority.
One workaround for you would be to implement on your own the folding mechanism without using Oxygen's CSS support for creating folds.
Using Oxygen's support for form controls you can add small expand/collapse buttons which when pressed can set a certain pseudo class on the current element. Based on that pseudo-class you can match in the CSS elements and assign various styles to them.
You can find some useful links on this previous forum post:
topic12842.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 26
- Joined: Wed Jun 26, 2013 1:08 am
Re: CSS selector for folded element
Post by avanlooveren »
Thanks, Radu.
This is what is discussed in this article, right? I mean, I create a button and an action that toggles the CSS pseudo-class via TogglePseudoClassOperation, right?
This is what is discussed in this article, right? I mean, I create a button and an action that toggles the CSS pseudo-class via TogglePseudoClassOperation, right?
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