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 broken on latest Chrome

See original GitHub issue

The CSS Grid option grid-template-areas no longer works properly when converted to canvas on the latest version of Chrome (Version 99.0.4844.51).

Expected Behavior

image

Current Behavior

image

Steps To Reproduce

.card {
  display: grid;
  grid-template-columns: 100px auto;
  grid-template-rows: auto 100px 100px;
  grid-template-areas: 
    "header header"
    "one two"
    "three four";
  justify-items: center;
}
.card h1 {
  grid-area: header;
}
.card .i1 {
  grid-area: one;
}
.card .i2 {
  grid-area: two;
}
.card .i3 {
  grid-area: three;
}
.card .i4 {
  grid-area: four;
}
<div class="card">
  <h1>Thesis Paper</h1>
  <div class="i1">A</div>
  <div class="i2">B</div>
  <div class="i3">C</div>
  <div class="i4">D</div>
</div>

https://jsfiddle.net/Lk94cwxz/4/

Environment

  • html-to-image: 1.9.0
  • OS: Windows, Ubuntu
  • Browser: Version 99.0.4844.51 (Official Build) (64-bit)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
chahucommented, Apr 28, 2022

Yes, this is still affecting the current version of Chrome. For anyone needing a workaround here’s one solution: https://codepen.io/chahu/pen/abqobdL

1reaction
chahucommented, Aug 15, 2022

@chrisglein I can confirm your link does not render properly with “Chrome 104.0.5112.79 (Official Build) (64-bit)”. I’m guessing you could re-write your grid css to workaround this issue (maybe using grid-template-areas), but it does look like something is still broken with Chrome’s CSS grid implementation for your case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my css grid not working in Chrome (works in all other ...
I've setup a css grid with 3 columns to display our portfolio. I found a working code for Firefox and Internet Explorer and...
Read more >
CSS Grid Layout and progressive enhancement
Other than in Internet Explorer, CSS Grid Layout is unprefixed in Safari, Chrome, Opera, Firefox and Edge. Support for all the properties ...
Read more >
Rendering change in CSS Grid with auto sized columns
1. Open the attached demo page in Chrome < 80. 2. Find the two buttons placed in the auto column define that column's...
Read more >
My grid works in Firefox but not in Chrome, Android or Edge
wake689: The code works in Firefox but not in Chrome, You set the rows to auto but you need the first row to...
Read more >
CSS Grid Layout (level 1) | Can I use... Support ... - CanIUse
CSS Grid Layout (level 1). - CR. Method of using a grid concept to lay out content, providing a mechanism for authors to...
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