autoprefixer icon indicating copy to clipboard operation
autoprefixer copied to clipboard

grid-area prefixing missing when used with grid-template with grid area definitions

Open surfingsven opened this issue 8 years ago • 7 comments

I played around with the grid-template shorthand syntax today and discovered, that is seems only to be only partially implemented:

As per i. e. https://developer.mozilla.org/de/docs/Web/CSS/grid-template, use can use the following values for grid-template:

a) grid-template-rows / grid-template-columns values b) grid-template-areas grid-template-rows / grid-template-column values

a) seems to be working correctly.

grid-template: 1fr 1fr / auto

is transformed to

  -ms-grid-rows: 1fr 1fr;
  -ms-grid-columns: auto;

But b) seems not to be implemented. See example below:

SCSS input:

.box {
    display: grid;
    grid-template: "a b" auto / 1fr 1fr;

    #a {
        grid-area: a;
    }

    #b {
        grid-area: b;
    }
}

CSS output: Notice: -ms-grid-row and -ms-grid-column props are missing for #b.

.box {
  display: -ms-grid;
  display: grid;
  grid-template: "a b" auto / 1fr 1fr;
}

.box #a {
  grid-area: a;
}

.box #b {
  grid-area: b;
}

Would be very nice if you guys could also implement this use case.

surfingsven avatar Feb 16 '18 15:02 surfingsven

Wow, never thought about this syntax. Yeap, we support only areas in grid-template right now.

@evgeny-petukhov do you want next awesome challenge? :D grid-template syntax is more tricky than just area. It could combine different properties. But seems like without rocket science. Just parse it and use old logic.

ai avatar Feb 16 '18 15:02 ai

@derzwen as a temporary solution you can ignore shortcut and use long properties for the same result.

ai avatar Feb 16 '18 15:02 ai

Thanks! I'm just playing around with CSS Grids right now. I appreciate your CSS Grid support a lot and want to help to make it more robust/complete. So more issues might follow ;)

surfingsven avatar Feb 16 '18 15:02 surfingsven

@ai I'm ready for the challenge :) Definitely, we can fully implement grid-template syntax. I'll do it during this week.

yepninja avatar Feb 20 '18 23:02 yepninja

Done here #992

yepninja avatar Feb 21 '18 18:02 yepninja

PR was accepted

ai avatar Feb 23 '18 17:02 ai

Released in 8.1

ai avatar Mar 02 '18 20:03 ai