Last active
August 29, 2015 14:04
-
-
Save lisaq/18fcd3f1d7ed8caf82a3 to your computer and use it in GitHub Desktop.
LESS mixin for text centered in a solid circle
This file contains hidden or 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
/* 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