Skip to content

Instantly share code, notes, and snippets.

@ryanmorr
Created March 29, 2024 00:09
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 ryanmorr/076de228bd1b10ceb470e7b314f79f87 to your computer and use it in GitHub Desktop.
Save ryanmorr/076de228bd1b10ceb470e7b314f79f87 to your computer and use it in GitHub Desktop.
A simple pseudo-element to create a dropdown caret that scales with text in pure CSS
.dropdown-caret:after {
content: "";
display: inline-block;
width: 0;
height: 0;
margin-left: .255em;
vertical-align: middle;
border-top: .3em solid;
border-right: .3em solid transparent;
border-left: .3em solid transparent;
border-bottom: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment