aboutsummaryrefslogtreecommitdiff
path: root/html/MOZILLA_scrollbar_fix.css
blob: cdbd5c64c7fd94a85a51f08c670ccb2b709c8476 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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);
}