Modulo:Materialize colors examples: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
generate also a white+black palette |
+possibilità di avere i colori dei testi |
||
Riga 166:
-- Get the CSS class name for the text
-- @return string
function MaterialColorFlavor:getTextCSSClass( isText )
return self.flavor.isDark and not isText and 'white-text' or nil
end
---
-- Constructor for a MaterialColorFlavor
-- @param
-- @return string
function MaterialColorFlavor:getContainerCSSClass( isText )
local
local textSuffix = isText and '-text' or ''
local cssClass = self.color .. textSuffix
if self.flavor.name then
end
return
end
---
-- Get the container's CSS class, plus the text class (if any)
-- @param
-- @return string
function MaterialColorFlavor:getContainerCSSClassAndTextClass( isText )
return concatClasses(
self:getContainerCSSClass( isText ),
self:getTextCSSClass( isText )
)
end
Riga 230:
local colorPre = args.colorPre or ''
local colorPost = args.colorPost or '\n'
local
local isText = tostring( args.isText ) == '1'
-- for each color flavor, create some HTML
Line 237 ⟶ 238:
.. "<div class=" .. APIX
-- start HTML class name:
.. flavor:getContainerCSSClassAndTextClass( isText )
..
.. APIX .. ">"
-- displayed text:
.. flavor:getContainerCSSClass( isText )
.. "</div>"
.. colorPost
|