Module:SocialMedia: Difference between revisions

No edit summary
No edit summary
Line 79: Line 79:
end
end


-- Build a clickable icon link (now 32px) with alt text for accessibility:
-- Build a clickable icon link (now 24px) with alt text for accessibility:
-- [[File:Something.svg|32px|alt=ALT_TEXT|link=URL]]
-- [[File:Something.svg|24px|alt=ALT_TEXT|link=URL]]
local function buildIconLink(iconFile, altText, url)
local function buildIconLink(iconFile, altText, url)
     return string.format("[[%s|32px|alt=%s|link=%s]]", iconFile, altText, url)
     return string.format("[[%s|24px|alt=%s|link=%s]]", iconFile, altText, url)
end
end


Line 103: Line 103:
     end
     end


     -- Wrap all icons in a flex container that clears both sides,
     -- Use a flex container that clears any floats above and
     -- so they start from the left margin in a new block.
     -- starts a new block with margin-top.
     return table.concat({
     return table.concat({
         '<div style="clear: both; display: flex; flex-wrap: wrap; gap: 0.5em;">',
         '<div style="clear: both; margin-top: 1em; display: flex; flex-wrap: wrap; gap: 0.5em;">',
             table.concat(icons, ""),
             table.concat(icons, ""),
         '</div>'
         '</div>'