Skip to content

Commit dfcc8c9

Browse files
Update template.php
1 parent d147c3b commit dfcc8c9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

astroid/astroid-framework/framework/template.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,8 +1057,22 @@ public function getPresets()
10571057

10581058
public function inspect()
10591059
{
1060-
// $this->version;
1061-
// $this->astroidVersion;
1060+
// fix for typography
1061+
if ($this->version < 2.3) {
1062+
foreach (['body', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as $typo) {
1063+
$typoType = $this->params->get($typo . '_typography');
1064+
if (trim($typoType) == 'custom') {
1065+
$typoOption = $typo . '_typography_options';
1066+
$typoParams = $this->params->get($typoOption);
1067+
foreach (['font_size', 'font_size_unit', 'letter_spacing', 'letter_spacing_unit', 'line_height', 'line_height_unit'] as $prop) {
1068+
if (!is_string($typoParams->{$prop})) {
1069+
$typoParams->{$prop} = $typoParams->{$prop}->desktop;
1070+
}
1071+
}
1072+
$this->params->set($typoOption, $typoParams);
1073+
}
1074+
}
1075+
}
10621076
}
10631077
}
10641078

0 commit comments

Comments
 (0)