-- This module implements {{key press}}.
local kbdPrefix = '<kbd class="keyboard-key nowrap">'
'<kbd class=' ..
'"keyboard-key nowrap" ' ..
'style="border: 1px solid #aaa; ' ..
-- The following is an expansion of {{border-radius|0.2em}}
'-moz-border-radius: 0.2em; -webkit-border-radius: 0.2em; border-radius: 0.2em; ' ..
-- The following is an expansion of {{box-shadow|0.1em|0.1em|0.2em|rgba(0,0,0,0.1)}}
'-moz-box-shadow: 0.1em 0.1em 0.2em rgba(0,0,0,0.1); -webkit-box-shadow: 0.1em 0.1em 0.2em rgba(0,0,0,0.1); box-shadow: 0.1em 0.1em 0.2em rgba(0,0,0,0.1); ' ..
'background-color: #f9f9f9; ' ..
-- The following is an expansion of {{linear-gradient|top|#eee, #f9f9f9, #eee}}
'background-image: -moz-linear-gradient(top, #eee, #f9f9f9, #eee); background-image: -o-linear-gradient(top, #eee, #f9f9f9, #eee); background-image: -webkit-linear-gradient(top, #eee, #f9f9f9, #eee); background-image: linear-gradient(to bottom, #eee, #f9f9f9, #eee); ' ..
-- Force black color to fix [[phab:T200258]]
'color: #000; ' ..
'padding: 0.1em 0.3em; ' ..
'font-family: inherit; ' ..
'font-size: 0.85em;">'
local kbdSuffix = '</kbd>'
['c nw'] = 'C↖',
['c sw'] = 'C↙',
-- Xbox.
['xb a'] = 'Ⓐ',
['xb b'] = 'Ⓑ',
['xb x'] = 'Ⓧ',
['xb y'] = 'Ⓨ',
['xb lb'] = '╼',
['xb rb'] = '╾',
['xb lt'] = '⟅',
['xb rt'] = '⟆',
['xb back'] = '◀',
['xb start'] = '▶'
}
['c-nw'] = 'c nw',
['c-sw'] = 'c sw',
['xb-a'] = 'xb a',
['xb-b'] = 'xb b',
['xb-x'] = 'xb x',
['xb-y'] = 'xb y',
['xb-lb'] = 'xb lb',
['xb-rb'] = 'xb rb',
['xb-lt'] = 'xb lt',
['xb-rt'] = 'xb rt',
['xb-back'] = 'xb back',
['xb-start'] = 'xb start'
}
}
local result = Collection.new()
local chainDefault = args.chain or '+​'
for i, id in ipairs(args) do
if i > 1 then
result:add(kbdPrefix .. text .. kbdSuffix)
end
return result:joinmw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Key press/sandbox/styles.css'}
} .. result:join()
end
|