« Module:Charte » : différence entre les versions
Apparence
Aucun résumé des modifications Balise : Révoqué |
Aucun résumé des modifications Balise : Révocation manuelle |
||
| Ligne 2 : | Ligne 2 : | ||
local chartes = { | local chartes = { | ||
-- Exemple de chartes personnalisées | |||
biographie = { | |||
titre = "#6eacdc9c", | |||
soustitre = "#a9c8e09c", | |||
hr = "#6eacdc9c" | |||
}, | |||
empire = { | |||
titre = "#993333", | |||
soustitre = "#ffcccc", | |||
hr = "#cc6666" | |||
}, | |||
-- Couleurs par défaut | |||
defaut = { | |||
titre = "#eaecf0", | |||
soustitre = "#a2a9b1", | |||
hr = "#eaecf0" | |||
} | |||
} | } | ||
function p.couleur(frame) | function p.couleur(frame) | ||
local args = frame.args | |||
local charte = args["charte"] or "defaut" | |||
local type = args["type"] or "titre" | |||
if chartes[charte] and chartes[charte][type] then | |||
return chartes[charte][type] | |||
else | |||
return chartes["defaut"][type] or "#dddddd" | |||
end | |||
end | end | ||
return p | return p | ||
Version du 23 mai 2025 à 21:42
La documentation pour ce module peut être créée à Module:Charte/doc
local p = {}
local chartes = {
-- Exemple de chartes personnalisées
biographie = {
titre = "#6eacdc9c",
soustitre = "#a9c8e09c",
hr = "#6eacdc9c"
},
empire = {
titre = "#993333",
soustitre = "#ffcccc",
hr = "#cc6666"
},
-- Couleurs par défaut
defaut = {
titre = "#eaecf0",
soustitre = "#a2a9b1",
hr = "#eaecf0"
}
}
function p.couleur(frame)
local args = frame.args
local charte = args["charte"] or "defaut"
local type = args["type"] or "titre"
if chartes[charte] and chartes[charte][type] then
return chartes[charte][type]
else
return chartes["defaut"][type] or "#dddddd"
end
end
return p