Project

General

Profile

Download (1.21 KB) Statistics
| Branch: | Tag: | Revision:

haketilo / html / MOZILLA_scrollbar_fix.css @ 6247f163

1
/**
2
 * Hachette
3
 * Hacky fix for vertical scrollbar width being included in child's width.
4
 *
5
 * Copyright (C) 2021 Wojtek Kosior
6
 * Redistribution terms are gathered in the `copyright' file.
7
 */
8

    
9
/*
10
 * Under Mozilla browsers to avoid vertical scrollbar forcing horizontal
11
 * scrollbar to appear in an element we add the `firefox_scrollbars_hacky_fix'
12
 * class to an element for which width has to be reserved.
13
 *
14
 * This is a bit hacky and relies on some assumed width of Firefox scrollbar, I
15
 * know. And must be excluded from Chromium builds.
16
 *
17
 * I came up with this hack when working on popup. Before that I had the
18
 * scrollbar issue with tables in the options page and gave up there and made
19
 * the scrollbal always visible. Now we could try applying this "fix" there,
20
 * too!
21
 */
22

    
23
.firefox_scrollbars_hacky_fix {
24
    font-size: 0;
25
}
26

    
27
.firefox_scrollbars_hacky_fix>div {
28
    display: inline-block;
29
    width: -moz-available;
30
}
31

    
32
.firefox_scrollbars_hacky_fix>*>* {
33
    font-size: initial;
34
}
35

    
36
.firefox_scrollbars_hacky_fix::after {
37
    content: "";
38
    display: inline-block;
39
    visibility: hidden;
40
    font-size: initial;
41
    width: 14px;
42
}
43

    
44
.firefox_scrollbars_hacky_fix.has_inline_content::after {
45
    width: calc(14px - 0.3em);
46
}
(2-2/14)