跳转到内容

模組:沙盒/Cookai1205

维基百科,自由的百科全书
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