···11+# Isometric CSS cuboids?!
22+This is a hacky thing just because I wanted to see how it if could do work. In short, you declare the following HTML:
33+44+```html
55+<div class='isocube' style='--x: 20; --y: 10; --color: #ff00ff'></div>
66+```
77+88+And use the following CSS:
99+1010+```css
1111+:root {
1212+ --darken: black 30%;
1313+ --lighten: white 30%;
1414+}
1515+1616+@property --color {
1717+ syntax: "<color>";
1818+ inherits: true;
1919+ initial-value: #c0ffee;
2020+}
2121+2222+@property --size {
2323+ syntax: "<length>";
2424+ inherits: true;
2525+ initial-value: 32px;
2626+}
2727+2828+@property --x {
2929+ syntax: "<integer>";
3030+ inherits: true;
3131+ initial-value: 0;
3232+}
3333+3434+@property --y {
3535+ syntax: "<integer>";
3636+ inherits: true;
3737+ initial-value: 0;
3838+}
3939+4040+.isocube {
4141+ background-color: var(--color);
4242+ position: absolute;
4343+ width: var(--size);
4444+ height: var(--size);
4545+ left: calc(calc(var(--x) - var(--y)) * calc(var(--size) * 0.84));
4646+ top: calc(calc(var(--x) + var(--y)) * calc(var(--size) * 0.5));
4747+ transform: rotate(210deg) skewX(-30deg) scaleY(0.86603);
4848+}
4949+5050+.isocube::before {
5151+ content: '';
5252+ position: absolute;
5353+ background-color: color-mix(in oklab, var(--color), var(--darken));
5454+ width: 100%;
5555+ height: 100%;
5656+ transform-origin: 0 0;
5757+ transform: scaleY(1.13397) skewX(30deg) rotate(-210deg) rotate(-30deg) skewX(-30deg) scaleY(0.86603);
5858+}
5959+6060+.isocube::after {
6161+ content: '';
6262+ position: absolute;
6363+ background-color: color-mix(in oklab, var(--color), var(--lighten));
6464+ width: 100%;
6565+ height: 100%;
6666+ transform-origin: 0 0;
6767+ transform: scaleY(1.13397) skewX(30deg) rotate(-210deg) rotate(90deg) skewX(-30deg) scaleY(0.86603);
6868+}
6969+7070+```
7171+7272+And presto:
7373+7474+
7575+7676+## Notes
7777+This repo uses  to provide a "paint-by-click" grid. This is live [here](https://kettek.net/s/isocubes/).
7878+7979+An outstanding issue is that we should use implement our own matrix calculations as there seem to be floating point errors occurring due to having to undo/reverse prior CSS transforms. This undo/reverse is because I wanted the HTML syntax to just be a single element, not one for each face of the cube.