fixTextToContainer

function fitTextToContainer( container )
{
	const span = container.querySelector('span');
	const containerWidth = container.clientWidth;
	let fontSize = parseInt(window.getComputedStyle(container).fontSize);
	container.style.fontSize = fontSize + 'px';

	while ( span.scrollWidth > containerWidth && fontSize > 0 )
	{
		fontSize--;
		container.style.fontSize = fontSize + 'px';
	}
}