From 5dc507be8c5d90e88a80dc609c5c2c30072204f8 Mon Sep 17 00:00:00 2001 From: Dinoosauro <80783030+Dinoosauro@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:08:47 +0200 Subject: [PATCH] Update some styling - Now the toolbar icons are always centered, since it seems to be nicer overall - Added margin for the PWA promotion tab --- src/Components/Toolbar.tsx | 4 ++-- src/index.css | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Components/Toolbar.tsx b/src/Components/Toolbar.tsx index 3201f77..61ff1af 100644 --- a/src/Components/Toolbar.tsx +++ b/src/Components/Toolbar.tsx @@ -59,14 +59,14 @@ export default function Toolbar({ pageSettings, updatePage, settingsCallback, pd * Make sure no buttons are lost due to the div being justified in the center */ function fixToolbarContentJustification() { - if (checkFlexDiv.current && checkFlexDiv.current.getAttribute("data-autojustify") === "a") checkFlexDiv.current.style.justifyContent = checkFlexDiv.current.scrollWidth - checkFlexDiv.current.getBoundingClientRect().width > -3 && checkFlexDiv.current.scrollWidth - checkFlexDiv.current.getBoundingClientRect().width < 3 ? "center" : "left"; // Add a 3px tollerance for WebKit, since one of the two values might be a pixel greater than the other + if (checkFlexDiv.current) checkFlexDiv.current.style.justifyContent = checkFlexDiv.current.scrollWidth - checkFlexDiv.current.getBoundingClientRect().width > -3 && checkFlexDiv.current.scrollWidth - checkFlexDiv.current.getBoundingClientRect().width < 3 ? "center" : "left"; // Add a 3px tollerance for WebKit, since one of the two values might be a pixel greater than the other } useEffect(() => fixToolbarContentJustification()); useEffect(() => window.addEventListener("resize", () => fixToolbarContentJustification()), []) let generateColorValues = () => [{ name: "Green", value: "rgb(0,255,0)" }, { name: "Blue", value: "rgb(0,0,255)" }, { name: "Red", value: "rgb(255,0,0)" }, { name: "Accent color", value: getComputedStyle(document.body).getPropertyValue("--accent") }, ...JSON.parse(localStorage.getItem(`PDFPointer-CustomColor`) ?? "[]")]; // Make it a function so that the accent color is refreshed every time. return