Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created June 23, 2022 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeaVerou/43f5c9d872f153d4e5aa957a4d06f3ef to your computer and use it in GitHub Desktop.
Save LeaVerou/43f5c9d872f153d4e5aa957a4d06f3ef to your computer and use it in GitHub Desktop.
Never use circle size to convey information
/**
* Never use circle size to convey information
*/
div {
display: inline-flex; align-items: center; justify-content: center;
width: 200px;
aspect-ratio: 1 / 1;
padding: 1em;
background: radial-gradient(closest-side, hsl(220 10% 70%) calc(var(--p)), transparent 0) hsl(220 10% 90%);
border-radius: 50%;
font: bold 150%/1 system-ui;
color: white;
text-align: center;
}
<div style="--p: 25%">25%</div>
<div style="--p: 50%">50%</div>
<div style="--p: 75%">75%</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment