question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Stretch vs fill-available` warning doesn't make sense

See original GitHub issue

I’m having a hard time regarding #784. According to caniuse.com, no major browser actually seems to support this yet. At first it looks like chrome does, but in the footnotes it states

Chrome does not yet unprefix stretch (aka fill/fill-available), because the CSSWG is not ready for that yet. See Chromium bug

and it states that Firefox only supports it with a prefix, yet

Firefox currently supports the -moz-available property rather than -moz-stretch

Messing around in both browsers shows me that it doesn’t work in either.

My question / issue here is simply that the warnings generated for when I set any or all of the following:

.element {
    max-width: fill-available;
    max-width: -webkit-fill-available;
    max-width: -moz-available;
}

I get the warning (even if I’m using the prefixed version already)

Replace fill-available to stretch, because spec had been changed

but this warning is, as far as I can tell, both unnecessary and invalid. I searched around for a way to just silence the warning, but in #473 it seems that it was decided not to have a way to suppress warnings, and since I’m using Create React App in this project, it’s not as simple to just wire up the plugin as was suggested in #473 (unless I’m just not doing it right, which is definitely a possibility).

So now, if i set

.element {
    max-width: fill-available;
}

the output is unchanged, and I get the above warning, when it still seems to me like it should still add the prefixed versions and not show any warnings.

It may be a minor issue, and mostly just annoying, but it still seems to me to be a problem that should be addressed. To me, this is a prime example of why having a way to suppress warnings (like with eslint-style comments, etc.) has merits.

If I have any of this incorrect, please let me know.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

48reactions
aicommented, May 8, 2018

Your CSS input must be:

.element {
    max-width: stretch;
}

Autoprefixer will compile it to:

.element {
    max-width: -webkit-fill-available;
    max-width: -moz-available;
    max-width: stretch;
}

So Chrome/Firefox will get their custom values.

5reactions
tarunkollacommented, Jun 11, 2020

@polarathene based on the above comment:

autoprefixer should for the time being(it doesn’t though) detect usage of stretch/fill/fill-available and not prefix with -moz-available when it’s a value for a height property.

I dont see -moz- prefix for last 2 firefox versions.

Last 2 firefox versions: <kbd> Last 2 firefox versions autoprefixer results screenshot </kbd>

Last 2 versions: <kbd> Last 2 versions autoprefixer results screenshot </kbd>

Does this mean -moz- is not being prefixed for Firefox?

Read more comments on GitHub >

github_iconTop Results From Across the Web

"fill-available" | Can I use... Support tables for HTML5, CSS3, etc
Allows for the heights and widths to be specified in intrinsic values using the max-content , min-content , fit-content and stretch (formerly fill...
Read more >
moz-available and -webkit-fill-available in one width (CSS ...
For Mozilla I want to use the value of -moz-available , and when a user uses Opera, then CSS should get the values...
Read more >
Thomas Steiner on Twitter: "@simevidas I think it never ...
I think it never existed. This is the ones I'm aware of: max-width: -webkit-fill-available; // max-width: -moz-available; max-width: stretch;.
Read more >
A Complete Guide to Flexbox | CSS-Tricks
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible ...
Read more >
What Does "width: 100%" Do in CSS? - Impressive Webs
But It will happen if your parent element has an explicit width (like the example) and its child has width: 100% AND margins...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found