Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoprefixer processing comment to locally turn off grid polyfill continues to report IE related warnings #1333

Closed
rjgotten opened this issue Jul 3, 2020 · 6 comments · Fixed by #1334

Comments

@rjgotten
Copy link

rjgotten commented Jul 3, 2020

Given the following snippit of CSS

.usps > ul {
  display : flex; 
  // ...
}

@supports(grid-template-columns: repeat(auto-fit, minmax(200px, max-content))) {
  .usps > ul {
    /* autoprefixer grid: off */
    display               : grid;
    grid-gap              : 20px 10px;
    grid-template-columns : repeat(auto-fit, minmax(200px, max-content));
    justify-content       : center;
  }
}

Even though it is using the /* autoprefixer grid: off */ processing comment, this particular block continues to raise a warning that " IE does not support justify-content on grid containers ." when conditionally applying grid styling.

Elevating the processing comment to the scope of the @supports block itself yields the same result. It continues to report warnings related to IE's grid implementation. Only using /* autoprefixer: off */ in these places works as expected.

While that suffices in the current situation for my problem, it is highly non-desired that the entirety of Autoprefixer has to be turned off. This would start causing problems once these rules end up containing properties which do need prefixing, requiring that e.g. an artificially split CSS rule be maintained where autoprefixer can still be turned off.

Autoprefixer version : 9.8.4

@ai
Copy link
Member

ai commented Jul 4, 2020

Thanks for the issue.

Do you want to send a pull request to save your name in the project history? You will need to add this.gridStatus(decl, result) check before the warning.

@rjgotten
Copy link
Author

rjgotten commented Jul 4, 2020

@ai
Nah; I'm good as is. I just filed the issue; you actually found the fix. 👍
(Plus, I'm a bit pre-occupied currently in keeping other plates spinning, so to say.)

@ai
Copy link
Member

ai commented Jul 5, 2020

I will be able to fix it only after a few weeks. Too much work too.

@rjgotten
Copy link
Author

rjgotten commented Jul 6, 2020

When it rains it pours, right? ;)

Anyway; the current work-arounds I have will hold for the short term, so a few weeks is fine.
(A quick guessstimate is that a few weeks would be the time window before I could start on a PR as well.)

If for some reason I find the time to work on it sooner, can I notify you through this issue?

@ai
Copy link
Member

ai commented Jul 6, 2020

I am preparing PostCSS 8 right now. This release could take 2-4 weeks.

Dan503 pushed a commit to Dan503/autoprefixer that referenced this issue Jul 11, 2020
Dan503 pushed a commit to Dan503/autoprefixer that referenced this issue Jul 11, 2020
@ai ai closed this as completed in #1334 Jul 11, 2020
ai pushed a commit that referenced this issue Jul 11, 2020
…grid warning (#1334)

* Fix #1333 - /* autoprefixer grid: off */ will not output grid warnings

* Adding test for #1333 (preventing warnings when grid is turned off)

* Adding "npx" to "gulp play" command in playground CSS comment

Not everyone has Gulp installed globally.
This prevents people who don't have Gulp installed globally getting confused why "gulp play" doesn't work.

* Triggering a warning if "subgrid" is used for any CSS value

IE does not support subgrid and Autoprefixer can't polyfill subgrid either.

* Updating tests to include subgrid warning

Co-authored-by: Daniel Tonon <dan503.npm@gmail.com>
@ai
Copy link
Member

ai commented Jul 11, 2020

The fix was released in 9.8.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants