模組:If darkmode
local p = {}
function p._main(args)
local frame = mw.getCurrentFrame()
local root = mw.html.create()
if args["Tag"] then
args["tag"] = args["Tag"]
end
local ifdarkmode = root:tag(args["tag"] or 'span')
ifdarkmode
:addClass('ifdarkmode')
local nodarkmode = ifdarkmode:tag(args["tag"] or 'span')
local isdarkmode = ifdarkmode:tag(args["tag"] or 'span')
nodarkmode
:addClass('nodarkmode')
:wikitext(args[2])
isdarkmode
:addClass('isdarkmode')
:wikitext(args[1])
return frame:extensionTag {name = 'templatestyles', args = {src = 'if darkmode/styles.css'}} .. tostring(root)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:if darkmode'
})
return p._main(args)
end
return p