jsxtools / cqfill

Polyfill for CSS Container Queries
404 stars 4 forks source link

Lack of whitespace between @container and (RULE) cause problem #5

Open phanngl opened 3 years ago

phanngl commented 3 years ago

My first time filing an open source issue, please go easy on me :).

Using cqfill with PostCSS, when i leave a whitespace between @container and (RULE), the generated CSS code works. But when I remove the whitespace

@container(min-width: 700px) {
  .contained {
    /* styles applied when a container is at least 700px */
  }
}

which i think is valid, then the generated CSS become

@media--css-container and (min-width: 700px) {
...
}

The whitespace between @media and --css-container is gone and it does not work anymore.

Your thought on this ?

jonathantneal commented 3 years ago

Great find, @phanngl. Fixing in https://github.com/jsxtools/cqfill/commit/cb1efd5eb0e78c8efef455919761bb7394b4739c