forked from rauchg/slackin
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert dialog dimensions to em/rem for adjustability #prepwork
Converting every dimension/length in all dialog styling to be in terms of a 10px font size (chosen to be easy: 250px => 25em, 4px => .4em) makes it easy to adjust the overall size of things by changing just that one base font size unit that every dimension and length is in terms of. For example, a one-line change of adjusting the base font size unit to 15px would scale everything up by a factor of 150%. For the div, we can simply set the fontSize and convert all lengths from px to em. Since the div is mostly just a container for the iframe, it has few descendants and none override the fontSize (which is important because em wouldn't be 10px on such a descendant). For the splash page in the iframe, several elements do override the font size, so instead we set the font-size of the root element ('html') and convert all lengths from px to rem, aka "root em". Browser support for rem is pretty good, no IE8 but IE9+ and all modern browsers: http://caniuse.com/rem The one browser issue to deal with is that in IE9-10, rem doesn't work in the 'font' CSS shorthand property (documented on "Can I use" and also http://stackoverflow.com/q/16157342/362030 and http://codersblock.com/blog/font-shorthand-bug-in-ie10/ ) but the fix is pretty trivial.
- Loading branch information
1 parent
e3d3194
commit 6108430
Showing
2 changed files
with
55 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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