I'm using SASS/SCSS and want to create a @function/@mixin
which will figure the max possible font-size for a container, given a dynamic width.
For example:
<body style="font-size: 10px;">
<div style="width: 960px;"> <!--This width is dynamic-->
<span style="font-size: 12.3em">Patrick Rocks</span>
</div>
</body>
The unknown variable in this equation is the font-size
on the <span>
tag. I set it to 12.3em which would be 123px (relative to the font-size of the <body>
tag), but that could change depending on letter-spacing
font-family
or other aspects. Perhaps because of the complexity of this it would be best served to calculate this with JavaScript, or PHP.