Skip to content

Commit

Permalink
udpated sample styling
Browse files Browse the repository at this point in the history
  • Loading branch information
jongund committed May 23, 2024
1 parent 11fa5aa commit 43c3089
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions content/practices/high-contrast/high-contrast-practice.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
table.data img {
border: 1px solid gray;
}
#samples div.sample {
height: 30px;
width: 50px;
border: 1px solid gray;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -237,8 +242,10 @@ <h3 id="system-colors">System Colors</h3>
tdv.textContent = v.value;
tr.appendChild(tdv);
const tds = document.createElement('td');
tds.style.backgroundColor = v.value;
tds.textContent = " ";
const div = document.createElement('div');
div.classList.add('sample');
div.style.backgroundColor = v.value;
tds.appendChild(div);
tr.appendChild(tds);
const tdc = document.createElement('td');
tdc.style.fontFamily = 'monospace';
Expand All @@ -248,7 +255,7 @@ <h3 id="system-colors">System Colors</h3>
tdd.textContent = v.desc;
tr.appendChild(tdd);
tbodyNode.appendChild(tr);
const cStyle = window.getComputedStyle(tds);
const cStyle = window.getComputedStyle(div);
const colorHex = rgb2Hex(cStyle.backgroundColor);
tdc.textContent =colorHex;
}
Expand Down

0 comments on commit 43c3089

Please sign in to comment.