aboutsummaryrefslogtreecommitdiff
path: root/html/MOZILLA_scrollbar_fix.css
diff options
context:
space:
mode:
authorjahoti <jahoti@tilde.team>2021-12-03 00:00:00 +0000
committerjahoti <jahoti@tilde.team>2021-12-03 00:00:00 +0000
commitd16e763e240a2aefe3d4490cddff61893a35a1ea (patch)
tree1e90890a39798f6cd9a1c0886d1234ccc187f5b3 /html/MOZILLA_scrollbar_fix.css
parent591c48a6903bbf324361610f81c628302cae7049 (diff)
parent93dd73600e91eb19e11f5ca57f9429a85cf0150f (diff)
downloadbrowser-extension-d16e763e240a2aefe3d4490cddff61893a35a1ea.tar.gz
browser-extension-d16e763e240a2aefe3d4490cddff61893a35a1ea.zip
Merge branch 'koszko' into jahoti
Diffstat (limited to 'html/MOZILLA_scrollbar_fix.css')
-rw-r--r--html/MOZILLA_scrollbar_fix.css48
1 files changed, 48 insertions, 0 deletions
diff --git a/html/MOZILLA_scrollbar_fix.css b/html/MOZILLA_scrollbar_fix.css
new file mode 100644
index 0000000..cdbd5c6
--- /dev/null
+++ b/html/MOZILLA_scrollbar_fix.css
@@ -0,0 +1,48 @@
+/**
+ * This file is part of Haketilo.
+ *
+ * Function: Hacky fix for vertical scrollbar width being included in child's
+ * width.
+ *
+ * Copyright (C) 2021 Wojtek Kosior
+ * Redistribution terms are gathered in the `copyright' file.
+ */
+
+/*
+ * Under Mozilla browsers to avoid vertical scrollbar forcing horizontal
+ * scrollbar to appear in an element we add the `firefox_scrollbars_hacky_fix'
+ * class to an element for which width has to be reserved.
+ *
+ * This is a bit hacky and relies on some assumed width of Firefox scrollbar, I
+ * know. And must be excluded from Chromium builds.
+ *
+ * I came up with this hack when working on popup. Before that I had the
+ * scrollbar issue with tables in the options page and gave up there and made
+ * the scrollbal always visible. Now we could try applying this "fix" there,
+ * too!
+ */
+
+.firefox_scrollbars_hacky_fix {
+ font-size: 0;
+}
+
+.firefox_scrollbars_hacky_fix>div {
+ display: inline-block;
+ width: -moz-available;
+}
+
+.firefox_scrollbars_hacky_fix>*>* {
+ font-size: initial;
+}
+
+.firefox_scrollbars_hacky_fix::after {
+ content: "";
+ display: inline-block;
+ visibility: hidden;
+ font-size: initial;
+ width: 14px;
+}
+
+.firefox_scrollbars_hacky_fix.has_inline_content::after {
+ width: calc(14px - 0.3em);
+}