Created
November 2, 2011 08:52
-
-
Save yonbergman/1333205 to your computer and use it in GitHub Desktop.
Dynamically Shrinking Titles
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
# insert this somewhere right after document.load | |
@header = $('.header') | |
while (@header.height() > @header.parent().height()) | |
currentFontSize = parseInt(@header.css("font-size")) | |
@header.css("font-size", currentFontSize - 1) |
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
.header-wrapper | |
%h1.header= @title # dynamic title text |
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
$title-width: 560px; | |
$title-height: 50px; | |
$title-font-size: 28px; | |
.header-wrapper{ | |
width: $title-width; | |
height: $title-height; | |
overflow:hidden; | |
.header{ | |
line-height: $title-height; | |
font-size: $title-font-size; | |
font-weight: bold; | |
//..... other stylings | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment