W3C home > Mailing lists > Public > www-style@w3.org > December 2018

Re: Fall back to a different property:value pair if another property:value pair is not supported.

From: L. David Baron <dbaron@dbaron.org>
Date: Tue, 11 Dec 2018 13:22:39 -0800
To: Philip Taylor <P.Taylor@Rhul.Ac.Uk>
Cc: www-style@w3.org
Message-ID: <20181211212239.GA32419@pescadero.dbaron.org>
On Tuesday 2018-12-11 17:35 +0000, Philip Taylor wrote:
> Browser support for "width: fit-content" is good but not universal (albeit requiring vendor prefixes in some cases) and for those cases where support is completely lacking one can fall back to "display: table".  However, I do not wish to abuse the "display" property in this way if it is unnecessary so to do.  Is there any standards-compliant way of falling back on "display: table" IFF "width: <possible vendor prefix>fit-content" is unsupported (as in the case of, e.g., Internet Explorer) ?

Yes.  See https://drafts.csswg.org/css-conditional/#at-supports and
https://developer.mozilla.org/en-US/docs/Web/CSS/@supports .

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Received on Tuesday, 11 December 2018 21:23:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 11 December 2018 21:23:07 UTC