Created
June 23, 2022 11:17
-
-
Save LeaVerou/43f5c9d872f153d4e5aa957a4d06f3ef to your computer and use it in GitHub Desktop.
Never use circle size to convey information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="--p: 25%">25%</div> | |
<div style="--p: 50%">50%</div> | |
<div style="--p: 75%">75%</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alert('Hello world!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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