Page MenuHomePhabricator

Support "width: fit-content" in TemplateStyles/Sanitized CSS
Open, Needs TriagePublicFeature

Description

The fit-content keyword for the CSS width property is currently defined in the CSS Box Sizing Module Level 4 Editor's Draft, but it is based on the fit-content() definition from the CSS Box Sizing Module Level 3 Working Draft (both of which are standards track).

The change between them is simply from a CSS function to a keyword, but both do the same thing: they invoke the user agent's native content-width calculation. And the reason for the deferment from Level 3 to Level 4 was the overall design of "intrinsic sizing" (of which fit-content is a part) rather than significant changes to fit-content itself.

width: fit-content is well supported by all modern browsers (minus IE). Most browsers added support for this in the 2015–2017 timeframe, including Firefox, but Firefox still needs the -moz- prefix. In other words: it's still just a bit early to use in MediaWiki core or default skins, but plenty mature enough in controlled and limited use cases like TemplateStyles.

Slightly related: T216897

Event Timeline

At least add the possibility of saving the page. Currently it blocks you for even doing that (other "invalid" code passes just as well)

Not being able to save unrecognized CSS is the entire point of TemplateStyles.

Not being able to save unrecognized CSS is the entire point of TemplateStyles.

Which is why this task is asking to recognize this widely recognized CSS

Izno changed the subtype of this task from "Task" to "Feature Request".Jan 14 2023, 1:54 AM