JSFiddle - React, Tailwind, and code Playground

by Christian Sonne

HTML

<div id="outer">
  <div id="inner"></div>
</div>
<p>Test of how well linear gradients adhere to the pixel values they are provided. Scaled up to see errors more easily.</p>

CSS

* {
  margin: 0;
  padding: 0;
}

p {
  margin-top: 200px;
}

div#outer {
  transform: scale(10);
  transform-origin: 0 0;
  height: 20px;
  background: linear-gradient(to right, blue 0, blue 10px, green 10px, green 20px, transparent 20px);
}

div#inner {
  height: 10px;
  width: 10px;
  background: red;
  margin-left: 10px;
  position: relative;
}

div#inner:after {
  content: "";
  display: block;
  position: absolute;
  height: 1px;
  width: 1px;
  background: black;
  bottom: 0;
  left: 0;
}