Module:Side box: Difference between revisions

we cookin with plainlist templatestyles now
m (1 revision imported: Templates and CSS files)
imported>Izno
(we cookin with plainlist templatestyles now)
 
Line 29: Line 29:
if args.image and args.image ~= 'none' then
if args.image and args.image ~= 'none' then
data.image = args.image
data.image = args.image
end
-- we have to check to see if a downstream use has plainlist like
-- Template:Sister_project. also it's the default. wikitext is :(
if args.textclass == 'plainlist' or not args.textclass then
data.textclass = 'plainlist'
data.plainlist_templatestyles = 'Plainlist/styles.css'
else
data.textclass = args.textclass
end
end


Line 36: Line 45:
'role',
'role',
'labelledby',
'labelledby',
-- Classes
'textclass',


-- Styles
-- Styles
Line 77: Line 82:
if data.style then
if data.style then
root:cssText(data.style)
root:cssText(data.style)
end
local frame = mw.getCurrentFrame()
if data.plainlist_templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles', args = { src = data.plainlist_templatestyles }
})
end
end


Line 105: Line 117:
local text = body:newline():tag('div')
local text = body:newline():tag('div')
text:addClass('side-box-text')
text:addClass('side-box-text')
:addClass(data.textclass or 'plainlist')
:addClass(data.textclass)
if data.textstyle then
if data.textstyle then
text:cssText(data.textstyle)
text:cssText(data.textstyle)
Line 128: Line 140:


root:newline()
root:newline()
local frame = mw.getCurrentFrame()
local templatestyles = ''
local templatestyles = ''
if data.templatestyles then
if data.templatestyles then
Anonymous user