Is there a way to set the font-size dynamically based on the containers size with CSS? At the momentan I'm using the following JS code to achieve this behaviour:
var cubeText = function() {
var fontSize = parseInt($(".cube.avatar").width());
fontSizeBig = fontSize/3.5
fontSizeSmall = fontSize/6;
console.log(fontSize);
$(".cube span.big").css('font-size', fontSizeBig);
$(".cube span.small").css('font-size', fontSizeSmall);
}
This has one big drawback: The test pops in and after the page is loaded resized which gives a very unpleasant "ploping" effect.