aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/appearance
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-11-10 06:11:01 +0530
committerLibravatar GitHub <noreply@github.com>2021-11-10 06:11:01 +0530
commit19fd8043bcd8ff0f8f0a85f409480fb36c82618d (patch)
tree023475b32d2cfc202098ad6ea425c34f78fb0889 /src/features/appearance
parentUpdate submodules, browserslist data updates and linter fixes [skip ci] (diff)
downloadferdium-app-19fd8043bcd8ff0f8f0a85f409480fb36c82618d.tar.gz
ferdium-app-19fd8043bcd8ff0f8f0a85f409480fb36c82618d.tar.zst
ferdium-app-19fd8043bcd8ff0f8f0a85f409480fb36c82618d.zip
fix: Force the minimum icon size to 2 if the calculated icon size becomes negative. Fixes #2199 (#2204)
Diffstat (limited to 'src/features/appearance')
-rw-r--r--src/features/appearance/index.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/features/appearance/index.ts b/src/features/appearance/index.ts
index aa40a5f52..fe8793dc1 100644
--- a/src/features/appearance/index.ts
+++ b/src/features/appearance/index.ts
@@ -164,6 +164,9 @@ function generateServiceRibbonWidthStyle(widthStr, iconSizeStr, vertical, isLabe
164 tabItemHeightBias = -5; 164 tabItemHeightBias = -5;
165 } 165 }
166 166
167 // Due to the lowest values for SIDEBAR_WIDTH and ICON_SIZES, this can be computed to a negative value
168 const minimumAdjustedIconSize = Math.max(width / 2 + iconSize, 2);
169
167 return vertical 170 return vertical
168 ? ` 171 ? `
169 .sidebar { 172 .sidebar {
@@ -177,7 +180,7 @@ function generateServiceRibbonWidthStyle(widthStr, iconSizeStr, vertical, isLabe
177 overflow: hidden !important; 180 overflow: hidden !important;
178 } 181 }
179 .tab-item .tab-item__icon { 182 .tab-item .tab-item__icon {
180 width: ${width / 2 + iconSize}px !important; 183 width: ${minimumAdjustedIconSize}px !important;
181 } 184 }
182 .sidebar__button { 185 .sidebar__button {
183 font-size: ${width / 3}px !important; 186 font-size: ${width / 3}px !important;
@@ -210,7 +213,7 @@ function generateServiceRibbonWidthStyle(widthStr, iconSizeStr, vertical, isLabe
210 height: min-content !important; 213 height: min-content !important;
211 } 214 }
212 .tab-item .tab-item__icon { 215 .tab-item .tab-item__icon {
213 width: ${width / 2 + iconSize}px !important; 216 width: ${minimumAdjustedIconSize}px !important;
214 } 217 }
215 .sidebar__button { 218 .sidebar__button {
216 font-size: ${width / 3}px !important; 219 font-size: ${width / 3}px !important;