Dynamic width for block elements using CSS

mu258770
Posts: 121

Dynamic width for block elements using CSS

Tue Sep 04, 2018 8:40 am

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: 5987

Re: Dynamic width for block elements using CSS

Tue Sep 04, 2018 9:47 am

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: 121

Re: Dynamic width for block elements using CSS

Tue Sep 04, 2018 10:20 am

Hi Radu,

Thanks for your reply! :D

Regards
Shabeer

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 4 guests