I want to know if possible to convert a CSS grid template track from pixels to fr.
In example, I have a DIV element with 1894px of width and 200px of height with a class .grid
.grid {
display: grid;
width: 1894px;
min-height: 200px;
grid-template-columns: 1196px 100px repeat(2, 1fr);
grid-template-rows: 1fr repeat(3, 0.5fr) 1fr;
margin: 10px;
gap: 0px;
}
So I want to know to how convert the value 1196px of first track of grid-template-columns to fr.
Also, what happens in case the gap is greater than 0?
In Chrome DevTools when search the expected value manually I get 1196px when changing the track value to 4fr and then check values in the Computed tab, but, how I can get this value in Javascript?