Module:Abilities/card: Difference between revisions

Jump to navigation Jump to search
Vergir (talk | contribs)
m another take on improving font-size calc for upgradebox
Vergir (talk | contribs)
m make fontsize shrink on upgradeboxes trigger later/less
Line 427: Line 427:
-- 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 = '1rem'
local fontsize = '1rem'
if desc_length > 20 and desc_length < 41 then
if desc_length > 30 and desc_length < 51 then
fontsize = '0.9rem'
fontsize = '0.9rem'
elseif desc_length > 40 and desc_length < 61 then
elseif desc_length > 50 and desc_length < 71 then
fontsize = '0.8rem'
fontsize = '0.8rem'
elseif desc_length > 60 then
elseif desc_length > 70 then
fontsize = '0.7rem'
fontsize = '0.7rem'
end
end