Dynamic width for block elements using CSS

Post here questions and problems related to editing and publishing DITA content.
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Dynamic width for block elements using CSS

Post by mu258770 »

Hi

Is it possible to have different width for the block elements using oXygen css when it is collapsed and expanded.

We have draft-element which is a block element,We want to have to reduce the width of block when it is collapsed and we want to have different width when it is expanded.

Code: Select all

*[class~="topic/draft-comment"]{
-oxy-foldable: true;
-oxy-folded:true;
display: block;
width : 50em;
border-left: thick solid;
border-right: thick solid;
}
Regards
Shabeer
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dynamic width for block elements using CSS

Post by Radu »

Hi Shabeer,

What you want is not achievable right now, we do have some improvement requests added to our issues list which might help with this use case. For example we have an issue to support the calc() CSS function, meaning that you would be able to express the width like this:

Code: Select all

width:calc(100% - 16rem);
where that 100% is the entire screen width. We also have an internal issue to support a pseudo selector like this:

Code: Select all

*[class~="topic/draft-comment"]:folded {
....
}
which would only be activated when the draft comment element would be folded.

If at some point we implement a feature which would be useful for this use case I'll update this forum thread.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: Dynamic width for block elements using CSS

Post by mu258770 »

Hi Radu,

Thanks for your reply! :D

Regards
Shabeer
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dynamic width for block elements using CSS

Post by Radu »

Hi,

As an update Oxygen version 22 supports the CSS calc() function in the Author visual editing mode.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply