Subscribe on changes!

`fit-content` is not correctly prefixed in inline-style

avatar
Aug 23rd 2021

Vue / its compiler doesn't do autoprefixing. This is the responsibility of the css tooling you choose in your build setup, i.e. postcss-loader + autoprefixer plugin with webpack.

avatar
Aug 23rd 2021
avatar
Aug 23rd 2021

Oh. I was honestly unaware we do this in Vue 3. Apologies ^^

avatar
Aug 24th 2021

The catch is that this issue is a static inline style="height: fit-content", whereas my understanding is that Vue performs some style auto-prefixing in bound values only: :style="{ height: 'fit-content' }".

At least that's what the docs seem to say, and doing the former would be expensive as it would defeat the static hoisting.

avatar
Aug 24th 2021

The catch is that this issue is a static inline style="height: fit-content", whereas my understanding is that Vue performs some style auto-prefixing in bound values only: :style="{ height: 'fit-content' }".

If this is the case, I'd expect this modified playground to work in Firefox.

For example this version works

Thanks for the workaround!

avatar
Sep 17th 2021

Vue only prefixes property names. fit-content is a property value. Unfortunately I don't think there is a way to automatically detect values that need prefixing at runtimes.

avatar
Sep 17th 2021

Btw re @jods4 's comment - static string style bindings are in fact pre-compiled into constant objects so they work the same with object bindings.