Skip to content

Instantly share code, notes, and snippets.

@andrexduarte
Last active November 27, 2017 14:46
Show Gist options
  • Save andrexduarte/5198069 to your computer and use it in GitHub Desktop.
Save andrexduarte/5198069 to your computer and use it in GitHub Desktop.
$(function(){
var $quote = $(".post p:first");
var $numWords = $quote.text().split(" ").length;
if (($numWords >= 1) && ($numWords < 10)) {
$quote.css("font-size", "36px");
}
else if (($numWords >= 10) && ($numWords < 20)) {
$quote.css("font-size", "32px");
}
else if (($numWords >= 20) && ($numWords < 30)) {
$quote.css("font-size", "28px");
}
else if (($numWords >= 30) && ($numWords < 40)) {
$quote.css("font-size", "24px");
}
else {
$quote.css("font-size", "20px");
}
});
@akinhwan
Copy link

someone should make this into a SASS mixin! I will post here when I complete one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment