Home
Random
Log in
Settings
About ARC Technical Repository
Disclaimers
Search
Editing
Module
:
Optional style
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
--[=[ Simple module to construct a style attribute with an undefined number (including zero) of CSS properties ]=] local p = {} --p stands for package local getArgs = require('Module:Arguments').getArgs --[=[ Construct the string from the given table of property:values ]=] function p.make_style_string(properties) local out = '' for k, v in pairs(properties) do if k ~= 'style' and v~= '' then out = out .. k .. ':' .. v .. ';' end end if properties.style ~= nil and properties.style ~= '' then out = out .. properties.style end if out == '' then return '' end return 'style="' .. out .. '"' end --[=[ The main entry function from templates Arguments are taken from both frame and parent argument lists ]=] function p.optional_style(frame) local args = getArgs(frame) return p.make_style_string(args) end return p
Summary:
Please note that all contributions to ARC Technical Repository may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TechRepo:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Pages included on this page:
Template:Lua
(
edit
)
Template:Template link
(
edit
)
Template:Tl
(
edit
)
Module:List
(
edit
)
Module:Lua banner
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Optional style/doc
(
edit
)
Module:TableTools
(
edit
)
Module:Yesno
(
edit
)