Module:Layout/Production/View/Gradient

 Deze module is nog in ontwikkeling (versie 0.0) en wordt getest.

De Module:Layout is bedoeld om snel, consistent en uitgebreid een pagina op te maken.
Er is een op de module afgestemde handleiding over deze onderwijswiki beschikbaar.

De module wordt geïnitialiseerd met de configuratie in Module:Layout/Production/Configuration.

Controleer op scriptfouten of opmaak notificaties.




local gradient = {};

function gradient.main( call )
   local frame = call.frame;
   return frame.args[ "part" ];
end

function gradient.box( text, align, color, textcolor )
    local gradient_box = mw.html.create('div');
    gradient_box:css('width', '100%');
    gradient_box:css( 'border-top', '20px solid' );
    gradient_box:css( 'border-bottom', '20px solid' );
    gradient_box:css( 'border-image', 'linear-gradient(to bottom, transparent, ' .. color .. ', transparent) 20' );
    local inner_box = mw.html.create( 'div' );
    inner_box:css({
        ['text-align']      = align,
        ['border-top']      = '20px solid linear-gradient(to bottom, transparent, ' .. color .. ')', 
        ['border-bottom']   = '20px solid linear-gradient(to top, transparent, ' .. color .. ')',
        ['color']           = textcolor;
        ['list-style-type'] = 'none'
    });
    inner_box:node(  text );
    gradient_box:node( inner_box );
    return tostring( gradient_box ) ;
end

return gradient;
Informatie afkomstig van https://nl.wikibooks.org Wikibooks NL.
Wikibooks NL is onderdeel van de wikimediafoundation.