File: headers-color.goml

package info (click to toggle)
rustc 1.70.0%2Bdfsg1-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 722,120 kB
  • sloc: xml: 147,962; javascript: 10,210; sh: 8,590; python: 8,220; ansic: 5,901; cpp: 4,635; makefile: 4,001; asm: 2,856
file content (70 lines) | stat: -rw-r--r-- 2,410 bytes parent folder | download | duplicates (3)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// This test check for headers text and background colors for the different themes.

define-function: (
    "check-colors",
    (theme, color, code_header_color, focus_background_color, headings_color),
    block {
        go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
        // This is needed so that the text color is computed.
        show-text: true
        set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
        reload:
        assert-css: (
            ".impl",
            {"color": |color|, "background-color": "rgba(0, 0, 0, 0)"},
            ALL,
        )
        assert-css: (
            ".impl .code-header",
            {"color": |code_header_color|, "background-color": "rgba(0, 0, 0, 0)"},
            ALL,
        )
        go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
        assert-css: (
            "#impl-Foo",
            {"color": |color|, "background-color": |focus_background_color|},
        )
        go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
        assert-css: (
            "#method\.must_use",
            {"color": |color|, "background-color": |focus_background_color|},
            ALL,
        )
        go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
        assert-css: (".small-section-header a", {"color": |color|}, ALL)
        go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
        // We select headings (h2, h3, h...).
        assert-css: (".docblock > :not(p) > a", {"color": |headings_color|}, ALL)
    },
)

call-function: (
    "check-colors",
    {
        "theme": "ayu",
        "color": "rgb(197, 197, 197)",
        "code_header_color": "rgb(230, 225, 207)",
        "focus_background_color": "rgba(255, 236, 164, 0.06)",
        "headings_color": "rgb(57, 175, 215)",
    },
)
call-function: (
    "check-colors",
    {
        "theme": "dark",
        "color": "rgb(221, 221, 221)",
        "code_header_color": "rgb(221, 221, 221)",
        "focus_background_color": "rgb(73, 74, 61)",
        "headings_color": "rgb(210, 153, 29)",
    },
)
call-function: (
    "check-colors",
    {
        "theme": "light",
        "color": "rgb(0, 0, 0)",
        "code_header_color": "rgb(0, 0, 0)",
        "focus_background_color": "rgb(253, 255, 211)",
        "headings_color": "rgb(56, 115, 173)",
    },
)