Module:Key/sandbox: Difference between revisions

Content deleted Content added
Small fix
Tags: Mobile edit Mobile web edit
No edit summary
 
(9 intermediate revisions by 4 users not shown)
Line 1:
-- 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); ' ..
'padding: 0.1em 0.3em; ' ..
'font-family: inherit; ' ..
'font-size: 0.85em;">'
 
local kbdSuffix = '</kbd>'
Line 37 ⟶ 24:
['backspace'] = '← Backspace',
['[[backspace]]'] = '← [[Backspace]]',
['win'] = '[[File:Windows logo - 2012 derivative (black).svg|12px|alt=|link=]] Win',
['[[windows key|win]]'] = '[[File:Windows logo - 2012 derivative (black).svg|12px|alt=|link=Windows key]] [[Windows key|Win]]',
['menu'] = '≣ Menu',
['[[menu key|menu]]'] = '≣ [[Menu key|Menu]]',
Line 180 ⟶ 167:
result:add(kbdPrefix .. text .. kbdSuffix)
end
return result:joinmw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Key press/sandbox/styles.css'}
} .. result:join()
end