Module:Abilities/card: Difference between revisions

Vergir (talk | contribs)
Better fontsize calculation for upgrades who don't have readymade lang keys
Vergir (talk | contribs)
m another take on improving font-size calc for upgradebox
Line 426: Line 426:
-- Vary the font size based on the number of characters to prevent overflow
-- Vary the font size based on the number of characters to prevent overflow
local fontsize = '0.85rem'
local fontsize = '1rem'
if desc_length > 60 and desc_length < 71 then
if desc_length > 20 and desc_length < 41 then
fontsize = '0.9rem'
elseif desc_length > 40 and desc_length < 61 then
fontsize = '0.8rem'
fontsize = '0.8rem'
elseif desc_length > 70 and desc_length < 91 then
elseif desc_length > 60 then
fontsize = '0.75rem'
elseif desc_length > 90 then
fontsize = '0.7rem'
fontsize = '0.7rem'
end
end