Skip to content

Instantly share code, notes, and snippets.

@jwdallas
Created July 2, 2013 22:14
Show Gist options
  • Save jwdallas/5913729 to your computer and use it in GitHub Desktop.
Save jwdallas/5913729 to your computer and use it in GitHub Desktop.
show icon based on text length
/* show icon based on text length */
* { margin:0; padding:0 }
li {
display: inline-block;
background: hsla(190,100%,50%,0.3);
border-left: 3px solid hsl(190,100%,50%);
width: 130px;
padding: 4px 10px 40px 6px;
margin: 20px;
}
h1 {
font: 100 14px/1.4 'Helvetica';
height: 1em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
h1:after {
content: '';
background: url(http://i.imgur.com/UFpYzHF.png);
width: 18px;
height: 12px;
float: left;
margin-right: 4px;
margin-top: 2px
}
<li><h1>Lunch with Tim</h1>
<li><h1>Lunch with Jonathan</h1>
// alert('Hello world!');
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment