Module:InfoboxProperty

local p = {} local siteColorModule = require("Module:SiteColor")

function p.getRow(name, value, color, style) -- If the value is empty, add a "display:none" style local rowStyle = "" if value == "" then rowStyle = "style=\"display: none;\"" end

local rowTable = {}

-- Add the first cell, with styling for color and gradient local firstCellStyleParts = { "|- ", rowStyle, "\n|style=\"padding: 5px; ",       "background: linear-gradient(to right, rgba(", color, ", 0.3) 0%, rgba(", color, ", 0) 100%); ",        "border-width: 1px 0px 1px 5px; border-style: solid; ",        "border-color: rgba(", color, ", 0.5); border-radius: 5px 0px 0px 5px;\"", "|", name, "" }

table.insert(rowTable, table.concat(firstCellStyleParts))

-- Add the second cell table.insert(rowTable, table.concat({"|style=\"", style, "\"|", value}))

return table.concat(rowTable, "\n") end

function p.main(frame) local args = frame:getParent.args -- Pull out the args from the frame and pass to getRow local color = args["color"] or siteColorModule.getSiteColor("Generic") local name = args[1] or "" local value = args[2] or "" local style = args["style"] or ""

return p.getRow(name, value, color, style) end

return p