Module:Infobox: Difference between revisions

titlebg light and dark mode
light dark titlebg
Line 12: Line 12:
    :css('padding-bottom', '4px')
    :css('padding-bottom', '4px')
local titlebg
local light = (args['titlebg-light'] and args['titlebg-light'] ~= '') and args['titlebg-light'] or 'var(--vw-accent-subtle)'
if (args['titlebg-light'] and args['titlebg-light'] ~= '') or
local dark  = (args['titlebg-dark']  and args['titlebg-dark']  ~= '') and args['titlebg-dark']  or 'var(--vw-accent-subtle)'
  (args['titlebg-dark']  and args['titlebg-dark']  ~= '') then
local titlebg = 'light-dark(' .. light .. ', ' .. dark .. ')'
    local light = (args['titlebg-light'] and args['titlebg-light'] ~= '') and args['titlebg-light'] or 'var(--vw-accent-subtle)'
    local dark  = (args['titlebg-dark']  and args['titlebg-dark']  ~= '') and args['titlebg-dark']  or 'var(--vw-accent-subtle)'
    titlebg = 'light-dark(' .. light .. ', ' .. dark .. ')'
else
    titlebg = (args.titlebg and args.titlebg ~= '') and args.titlebg or 'var(--vw-accent-subtle)'
end
if args.title and args.title ~= '' then
if args.title and args.title ~= '' then
    root:tag('tr')
    root:tag('tr')