JSFiddle - React, Tailwind, and code Playground

by Brian Blakely

HTML

<canvas width="101" height="101"></canvas>

CSS

canvas {
    outline: 2px solid green;
}

JavaScript

var cvs = document.querySelector('canvas'),
    ctx = cvs.getContext('2d');

var cx = cvs.width/2 | 0,
    cy = cvs.height/2 | 0;

ctx.rect(cx-10, cy-10, 20, 20);
ctx.stroke();