Page 1 of 1

Dynamic width for block elements using CSS

Posted: Tue Sep 04, 2018 8:40 am
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

Re: Dynamic width for block elements using CSS

Posted: Tue Sep 04, 2018 9:47 am
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

Re: Dynamic width for block elements using CSS

Posted: Tue Sep 04, 2018 10:20 am
by mu258770
Hi Radu,

Thanks for your reply! :D

Regards
Shabeer