JSFiddle - React, Tailwind, and code Playground
by ericwilligers
HTML
<table id="report">
<tr>
<th>Property</th>
<th>Assigned</th>
<th>Serialized</th>
<th>Computed</th>
</tr>
</table>
<div id="container">
<div id="target">
<div id="child"></div>
</div>
</div>
CSS
#report {
color: black;
background-color: white;
}
JavaScript
test('grid-row-start', 'span 1 i');
test('grid-row-start', 'span i');
test('grid-row', 'span 1 i / auto');
test('grid-row', 'span i / auto');
/*
test('grid-auto-columns', '0px');
test('grid-auto-columns', 'fit-content(1px)');
test('grid-auto-columns', 'minmax(2px, 3px)');
test('grid-auto-columns', '1px 2px 3px 0px');
test('grid-auto-columns', 'fit-content(1px) minmax(2px, 3px) 4px');
test('grid-auto-rows', '0px');
test('grid-auto-rows', 'fit-content(1px)');
test('grid-auto-rows', 'minmax(2px, 3px)');
test('grid-auto-rows', '1px 2px 3px 0px');
test('grid-auto-rows', 'fit-content(1px) minmax(2px, 3px) 4px');
*/
function test(property, values) {
if (!Array.isArray(values)) {
values = [ values ];
}
for (let value of values) {
const row = document.createElement('tr');
const log = (content) => {
// console.log(content);
const cell = document.createElement('td');
cell.textContent = "'" + content + "'";
row.appendChild(cell);
}
target.style[property] = '';
target.style[property] = value;
log(property);
log(value);
log(target.style[property]);
log(getComputedStyle(target)[property]);
if (target.style[property] === '')
row.style['font-weight'] = 'bold';
report.appendChild(row);
target.style[property] = '';
}
}