- Welcome to Touhou Wiki!
- Registering is temporarily disabled. Check in our Discord server to request an account and for assistance of any kind.
Module talk:Styles
Jump to navigation
Jump to search
Documentation
For general notes on adding functions, please see Module talk:Common.
To use functions and constants from this library add the following code:
require("Module:Styles")
addstyle(tbl, val)
Makes adding styles to html tags a bit easier. Automatically skips empty styles and assures that added style ends with a semicolon.
Sample usage:
local function test(frame)
local span = {}
span[#span+1] = '<span style="text-align: center;'
addstyle(span, frame.args['style1'])
addstyle(span, frame.args['style2'])
-- ...
span[#span+1] = '">'
-- add content
span[#span+1] = '</span>'
return table.concat(span)
end