Replace ex units with ems for input lengths #2678
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It was recently questioned why we were using
ex
units (a unit equivalent to the font's x-height) to define the width of inputs. Ultimately, the original reasoning appears to have been lost to time.This PR replaces the use of
ex
units withem
equivalents for Input lengths.This makes sense as:
em
units are based on typeface width, rather than the heightem
andex
are both based on the font size, both affect the width of the input when the body font size is changedex
units are calculated differently by different browsers — IE 'cheats' and makesex
always equal half ofem
Rather than make one-to-one replacements of
ex
forem
, I rounded theem
units up to the nearest .25. This prevents an excessive amount of decimal places in the resulting pixel measurements, but does mean that these inputs are up to a few pixels wider than previously.ex
em
px
px