fontsize aussi en vmax

This commit is contained in:
Deltacms 2023-09-15 10:06:47 +02:00
parent eea87f081a
commit 9cf410325f
1 changed files with 4 additions and 2 deletions

View File

@ -2630,12 +2630,14 @@ class core extends common {
$colors = helper::colorVariants($this->getData(['theme', 'header', 'textColor']));
$css .= 'header #wallPaper span{color:' . $colors['normal'] . ';font-family:"' . $this->getData(['fonts', $this->getData(['theme', 'header', 'font']), 'name']) . '",sans-serif;font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}';
// En petit écran pour s'adapter à des textes longs
$titleLineHeight = str_replace(',','.',(str_replace(',','.',str_replace('em','',$this->getData(['theme', 'header', 'fontSize']))/2)+0.2)).'em';
$search ='em';
if( $this->getData(['theme', 'header', 'fontSize']) === '2.4vmax' ) $search = 'vmax';
$titleLineHeight = str_replace(',','.',(str_replace(',','.',str_replace($search,'',$this->getData(['theme', 'header', 'fontSize']))/2)+0.2)).'em';
//Si menu burger fixe et superposé à la bannière
if( $this->getData(['theme', 'menu', 'burgerFixed']) && $this->getData(['theme', 'menu', 'burgerOverlay'])) {
$titleMarginTop = strval($bannerHeight - 5).'px';
} else {
$titleMarginTop = ((int) str_replace('px','', $this->getData(['theme', 'header', 'height'])))/2 - $fontsize * ( str_replace('em','', $this->getData(['theme', 'header', 'fontSize'])));
$titleMarginTop = ((int) str_replace('px','', $this->getData(['theme', 'header', 'height'])))/2 - $fontsize * ( str_replace($search,'', $this->getData(['theme', 'header', 'fontSize'])));
$titleMarginTop = strval((int)$titleMarginTop).'px';
}
$css .= '@media (max-width: 799px) { header #themeHeaderTitle{ margin-top:'.$titleMarginTop.'; line-height:'.$titleLineHeight.';}}';