Closed Dan503 closed 6 years ago
cc @yepninja
@Dan503 We can fix it by adding a media query to each selector with grid-area
. Then you will need to use https://github.com/hail2u/node-css-mqpacker to merge media queries.
I've used media query merging software before, they do far more harm than good :(
Is it not possible to save them into an array then output them at the end into one media query block?
I don't really like the idea of each one getting wrapped in a separate media query :(
It's possible too. To my mind, we have 3 solutions for this case:
Duplicate query for each area
Creates way too much extra junk in the css file.
Duplicate query after the last area
That is the option I think works best. I think that this is what I requested in the issue isn't it?
Append everything to parent query, then move this query after last area (or to the end of all CSS)
Too much risk of specificity breaking due to drastic changes in the source order.
I think, if we want insert media after the last area, the third solution would be the best.
.... maybe.
There is a bit of risk in that the media query is going to be holding more than just grid styles in it.
Moving site styles away from where the author wrote them is a bit dangerous.
Moving an extra media query that was generated through autoprefixer that only holds IE prefixes is a lot less risky in my mind.
Yeah it's not as neat and tidy but shifting an authors styles around scares me a bit.
Agreed with you. It's not right to change authors styles. Let's try to implement the second solution.
@yepninja this is a high priority issue that should get fixed before the article is published.
@yepninja do you need help with it from Cult of Martians?
@ai Let's try
@yepninja I will create a task tomorrow. Can you write on Russian current plan?
Yep, I'll write plan today
@yepninja а что именно сделать надо?
Нужно поменять логику переопределения областей для media
. Сейчас новые позиции областей добавляются к медиа-выражению, где было переопредлено grid-template-areas
, соответсвенно если это медиа-выражение указаны вышо каких-то областей, то переопределние не стработает. Поэтому нужно дублировать медиа-выражение с переопределениями, и вставлять его всего после последней области.
Released in 8.6.1
Currently if I write this:
auto-prefixer outputs this:
The issue is that the media query code is being overwritten by the default styles so the media query ends up having no effect in IE.
You can write the input code like this instead which fixes the issue:
However it means you have to write half of your
.grid
styles at the top of the scss file and write the other half of the styles at the bottom. It is much nicer having them all centralised in one location.I'd prefer to have the autoprefixer output for the first example to be this: