Sort out pixelegg/preference font-size

This commit is contained in:
nathan 2024-03-26 09:13:19 -06:00
parent 25b343be7c
commit 9d0a7f556b
2 changed files with 7 additions and 5 deletions

View File

@ -42,10 +42,7 @@ export default [sl_css, css`
:root, :root,
:host, :host,
.sl-theme-light { .sl-theme-light {
--sl-font-size-medium: ${typeof egw != "undefined" && egw.preference && egw.preference('textsize', 'common') != '12' ? parseInt(egw.preference('textsize', 'common')) : 12}px; --sl-button-font-size-medium: var(--sl-font-size-medium);
--sl-input-height-small: 24px;
--sl-input-height-medium: 32px;
--sl-button-font-size-medium: ${typeof egw != "undefined" && egw.preference && egw.preference('textsize', 'common') != '12' ? parseInt(egw.preference('textsize', 'common')) : 12}px;
--sl-input-help-text-font-size-medium: var(--sl-font-size-medium); --sl-input-help-text-font-size-medium: var(--sl-font-size-medium);
--sl-spacing-small: 0.1rem; --sl-spacing-small: 0.1rem;
--sl-spacing-medium: 0.5rem; --sl-spacing-medium: 0.5rem;

View File

@ -120,7 +120,12 @@ class pixelegg_framework extends Api\Framework\Ajax
background-image: url($header); background-image: url($header);
} }
"; ";
$textsize = $GLOBALS['egw_info']['user']['preferences']['common']['textsize']; $textsize = $GLOBALS['egw_info']['user']['preferences']['common']['textsize'] ?? '12';
$ret['app_css'] .= "
:root, :host, body {
font-size: {$textsize}px;
}
";
if (!empty($textsize) && is_numeric($textsize) && $textsize != '12') if (!empty($textsize) && is_numeric($textsize) && $textsize != '12')
{ {
$iconSize = $textsize+2; $iconSize = $textsize+2;