CsQuery icon indicating copy to clipboard operation
CsQuery copied to clipboard

Allow Calc for width

Open benjamingr opened this issue 12 years ago • 3 comments

At the moment it is impossible to assign a calc expression as an element's width. This is pretty useful.

Edit Sorry for the undetailed issues, I report issues as I run into them. I tried setting .Css("width","calc(100%-100px)") and it failed.

benjamingr avatar Aug 04 '13 13:08 benjamingr

No problem - keep reporting them.

You can get around this by by using the DOMElement.SetStyles(string styles, bool strict) method to set styles (false for strict to disable syntax checking). There should probably be a global setting to disable strict mode too. This can easily be fixed of course but I don't think an outdated CSS spec should make things hard to work around.

jamietre avatar Aug 05 '13 18:08 jamietre

Yeah, it doesn't make things too hard to work with (and I ended up using SetStyles to resolve the issue). How hard is this to fix? Does it require touching validator.nu ?

benjamingr avatar Aug 06 '13 12:08 benjamingr

Not hard to fix, it's purely a CsQuery thing.

jamietre avatar Aug 06 '13 12:08 jamietre