Use merged theme in renderer CSS and for font-size slug translation
[MAILPOET-5740]
This commit is contained in:
committed by
Jan Lysý
parent
55dd1d0ab0
commit
512d47609e
@ -193,7 +193,6 @@ class SettingsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getStylesheetForRendering(): string {
|
public function getStylesheetForRendering(): string {
|
||||||
$coreThemeSettings = \WP_Theme_JSON_Resolver::get_core_data()->get_settings();
|
|
||||||
$emailThemeSettings = $this->getTheme()->get_settings();
|
$emailThemeSettings = $this->getTheme()->get_settings();
|
||||||
$css = '';
|
$css = '';
|
||||||
// Font family classes
|
// Font family classes
|
||||||
@ -201,16 +200,15 @@ class SettingsController {
|
|||||||
$css .= ".has-{$fontFamily['slug']}-font-family { font-family: {$fontFamily['fontFamily']}; } \n";
|
$css .= ".has-{$fontFamily['slug']}-font-family { font-family: {$fontFamily['fontFamily']}; } \n";
|
||||||
}
|
}
|
||||||
// Font size classes
|
// Font size classes
|
||||||
foreach ($coreThemeSettings['typography']['fontSizes']['default'] as $fontSize) {
|
foreach ($emailThemeSettings['typography']['fontSizes']['default'] as $fontSize) {
|
||||||
$css .= ".has-{$fontSize['slug']}-font-size { font-size: {$fontSize['size']}; } \n";
|
$css .= ".has-{$fontSize['slug']}-font-size { font-size: {$fontSize['size']}; } \n";
|
||||||
}
|
}
|
||||||
return $css;
|
return $css;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function translateSlugToFontSize(string $fontSize): string {
|
public function translateSlugToFontSize(string $fontSize): string {
|
||||||
$coreTheme = \WP_Theme_JSON_Resolver::get_core_data();
|
$settings = $this->getTheme()->get_settings();
|
||||||
$coreSettings = $coreTheme->get_settings();
|
foreach ($settings['typography']['fontSizes']['default'] as $fontSizeDefinition) {
|
||||||
foreach ($coreSettings['typography']['fontSizes']['default'] as $fontSizeDefinition) {
|
|
||||||
if ($fontSizeDefinition['slug'] === $fontSize) {
|
if ($fontSizeDefinition['slug'] === $fontSize) {
|
||||||
return $fontSizeDefinition['size'];
|
return $fontSizeDefinition['size'];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user