container-query-polyfill icon indicating copy to clipboard operation
container-query-polyfill copied to clipboard

'container-type' is overwritten

Open Nagell opened this issue 2 years ago • 3 comments

My container Class is using:

        container-type: inline-size;
        container-type: style;

but if this plugin is active the first instance is always changed to

        container: inline-size;

the plugin is still working somehow, despite it is throwing an error, but changing container-type: size to contain: size can cause some serious problems (and in my case it does).

https://developer.mozilla.org/en-US/docs/Web/CSS/contain

Nagell avatar Jan 26 '22 16:01 Nagell

Can you give me a small reproduction case in a gist or something where the results are different with the polyfill than with native CQs in Chrome Canary or something?

surma avatar Jan 27 '22 09:01 surma

Yup

    .c-features {
        container-type: size;
    }

    @container (min-width: 768px) {
        .c-features {
            & > li {
                max-width: 500px;
            }
        }
    }

Oh, I read it again and I'll prepare it soon - but for now you can test this one. Even this is enough to see the overwrite.

Nagell avatar Jan 27 '22 09:01 Nagell

Here it is: https://gist.github.com/343f39faf18dd0c009adb9d326c0fe85#file-index-html

Nagell avatar Jan 27 '22 10:01 Nagell

This issue should be resolved by the newest version of the polyfill (currently in alpha). Please give it a try and let me know if you run into any further issues.

Thank you!

devknoll avatar Aug 16 '22 16:08 devknoll