Skip to content

repeat() does not get resolved as per CSS Grid #146

Open
@moises-marquez

Description

@moises-marquez

Basic info:

  • Node.js version: 14.17
  • jsdom version: 18.0.0

Minimal reproduction case

The following code returns repeat(auto-fill, 300px) instead of 300px 300px as described in the CSS Grid spec (Note below example 19): https://www.w3.org/TR/css-grid-1/.

const { JSDOM } = require("jsdom");

const dom = new JSDOM(`
<!DOCTYPE html>
<html>
   <head>
      <title></title>
      <style>
         #gridParentElement {
         width: 700px;
         display: grid; 
         grid-template-columns: repeat(auto-fill, 300px);
         }
      </style>
   </head>
   <body>
      <div id="gridParentElement">
         <div class="gridChild"></div>
         <div class="gridChild"></div>
      </div>
   </body>
</html>
`);

const element = window.document.querySelector("#gridParentElement");

console.log(window.getComputedStyle(element).gridTemplateColumns);

How does similar code behave in browsers?

In browser, the returned value should be 300px 300px. Link to reproducible case:

https://jsfiddle.net/y67dx3fm/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions