W3C home > Mailing lists > Public > www-style@w3.org > November 2011

[css3-flexbox] change flex from script

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Tue, 8 Nov 2011 21:20:44 +0000
To: "www-style@w3.org list" <www-style@w3.org>
Message-ID: <D51C9E849DDD0D4EA38C2E539856928412D4CCB8@TK5EX14MBXC214.redmond.corp.microsoft.com>
Suppose I am writing a script that wants to only change flexibility on some flexbox items but not their preferred size.

For example, an element might have style.width = "flex(1 314px)" set previously. Not sure how.

Now, I want to change that to "flex(0 314px)". How do I do that?

style.width will return a string with flex() notation. The only way to get to old preferred width that I can think of is parsing flex() in script. Assuming that the value in style.width is always normalized (has length last and has "0px" even if default is used) parsing is not that hard, but still doing that is a hassle.

I am not sure how important it is to set flexibility separately, but if somebody needs that it is a problem. Not sure what to do about it either.

Also, how much did we discuss separate cascading of width and flex? With flex() it is not possible. Is it important that it is not possible?
Received on Tuesday, 8 November 2011 21:21:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:07 UTC