question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[css-grid] translate `grid` property syntax into IE safe syntax when possible

See original GitHub issue

This code

.grid {
    display: grid;
    grid:
      "left .... right" 100px /
       1fr  10px   1fr;
}

.left-cell { grid-area: left; }

.right-cell { grid-area: right; }

Should translate into this:

.grid {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 1fr 10px 1fr;
  -ms-grid-rows: 100px;
  grid:
      "left .... right" 100px /
       1fr  10px   1fr;
}

.left-cell {
  -ms-grid-row: 1;
  -ms-grid-column: 1;
  grid-area: left;
}

.right-cell {
  -ms-grid-row: 1;
  -ms-grid-column: 3;
  grid-area: right;
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
yepninjacommented, Apr 26, 2018

@Dan503 You are damn right! Your case is definitely the case of grid-template shortcut. grid shortcut also supports grid-template but also supports shortcuts with grid-auto- properties. So there are two reasons to use grid shortcut:

  1. You don’t want to write ‘-template’ in property and want to use shorter property.
  2. You want to use grid-auto- properties in the shortcut.

And of course, you want that these properties work in IE (that why we are here). So if you use grid-template you can be sure that everything works in IE. So in your case it’s better to use grid-template. If someone wants to use grid for the second reason, he must understand that grid-auto- properties don’t work in IE at all.

1reaction
aicommented, Apr 23, 2018

Hm. I will look later on this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic concepts of grid layout - CSS: Cascading Style Sheets
CSS Grid Layout introduces a two-dimensional grid system to CSS. Grids can be used to lay out major page areas or small user...
Read more >
A Complete Guide to CSS Grid
Our comprehensive guide to CSS grid, focusing on all the settings both for the grid parent container and the grid child elements.
Read more >
grid-template-rows | CSS-Tricks
The grid-template-rows CSS property is part of the CSS Grid Layout specification, defining the rows of a grid container by specifying the size ......
Read more >
CSS Grid in IE: CSS Grid and the New Autoprefixer
Update: In version 9.3.1 you can enable CSS Grid translations by simply adding a ... Span syntax requires grid-column-end to be defined.
Read more >
grid-template-areas | CSS-Tricks
So, if you have a top row in your grid container and you want the header of your layout to go in there,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found