<div data-radial-type="circle" data-size="closest-side" style="--ending-shape: circle;--size:closest-side"></div>
<div data-radial-type="ellipse" data-size="closest-side" style="--ending-shape: ellipse; --size:closest-side"></div>
<div data-radial-type="circle" data-size="farthest-side" style="--ending-shape:circle; --size:farthest-side"></div>
<div data-radial-type="ellipse" data-size="farthest-side" style="--ending-shape: ellipse; --size:farthest-side"></div>
<div data-radial-type="circle" data-size="closest-corner" style="--ending-shape: circle; --size:closest-corner"></div>
<div data-radial-type="ellipse" data-size="closest-corner" style="--ending-shape: ellipse; --size:closest-corner"></div>
<div data-radial-type="circle" data-size="farthest-corner" style="--ending-shape: circle; --size:farthest-corner"></div>
<div data-radial-type="ellipse" data-size="farthest-corner" style="--ending-shape: ellipse; --size:farthest-corner"></div>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100vw;
min-height: 100vh;
display: grid;
grid-template-columns:repeat(2, 40vh 1fr);
padding: 10px 10px 30px;
gap: 30px 10px;
font-family: "Exo", Arial, sans-serif;
background-color: #222;
color: #fff;
}
:root {
--color-start: #09f;
--color-end: rgba(255, 255, 255, 1);
--position: 50% 75%;
}
div {
border-radius: 5px;
border: 1px solid #efefef;
min-height: 40vh;
position: relative;
background-image: radial-gradient(
var(--ending-shape) var(--size) at var(--position),
var(--color-start),
var(--color-end)
);
}
div::after {
content: attr(data-radial-type) ' || ' attr(data-size);
position: absolute;
top: calc(100% + 5px);
white-space: nowrap;
left: 50%;
transform: translate(-50%, 0);
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.