Skip to content

Instantly share code, notes, and snippets.

@lisaq
Last active August 29, 2015 14:04
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 lisaq/18fcd3f1d7ed8caf82a3 to your computer and use it in GitHub Desktop.
Save lisaq/18fcd3f1d7ed8caf82a3 to your computer and use it in GitHub Desktop.
LESS mixin for text centered in a solid circle
/* centers text in a circle - input diameter of circle and color */
.circle (@diameter:50px,@color:#000) {
height: round(@diameter/2);
width: round(@diameter/2);
padding: round(@diameter/4);
font-size: round(@diameter/2);
line-height:1em;
.border-radius(50%);
text-align:center;
vertical-align:middle;
background-color:@color;
color:white;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment