|
| 1 | +// This test checks links colors. |
| 2 | +goto: file://|DOC_PATH|/test_docs/index.html |
| 3 | + |
| 4 | +// This is needed so that the text color is computed. |
| 5 | +show-text: true |
| 6 | + |
| 7 | +// Ayu theme |
| 8 | +local-storage: { |
| 9 | + "rustdoc-theme": "ayu", |
| 10 | + "rustdoc-use-system-theme": "false", |
| 11 | +} |
| 12 | +reload: |
| 13 | + |
| 14 | +assert-css: (".item-table .mod", {"color": "rgb(57, 175, 215)"}, ALL) |
| 15 | +assert-css: (".item-table .macro", {"color": "rgb(163, 122, 204)"}, ALL) |
| 16 | +assert-css: (".item-table .struct", {"color": "rgb(255, 160, 165)"}, ALL) |
| 17 | +assert-css: (".item-table .enum", {"color": "rgb(255, 160, 165)"}, ALL) |
| 18 | +assert-css: (".item-table .trait", {"color": "rgb(57, 175, 215)"}, ALL) |
| 19 | +assert-css: (".item-table .fn", {"color": "rgb(253, 214, 135)"}, ALL) |
| 20 | +assert-css: (".item-table .type", {"color": "rgb(255, 160, 165)"}, ALL) |
| 21 | +assert-css: (".item-table .union", {"color": "rgb(255, 160, 165)"}, ALL) |
| 22 | +assert-css: (".item-table .keyword", {"color": "rgb(57, 175, 215)"}, ALL) |
| 23 | + |
| 24 | +assert-css: ( |
| 25 | + ".sidebar-elems a:not(.current)", |
| 26 | + {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"}, |
| 27 | + ALL, |
| 28 | +) |
| 29 | +assert-css: ( |
| 30 | + ".sidebar-elems a.current", |
| 31 | + {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)", "font-weight": "500"}, |
| 32 | + ALL, |
| 33 | +) |
| 34 | + |
| 35 | + |
| 36 | +// Dark theme |
| 37 | +local-storage: {"rustdoc-theme": "dark"} |
| 38 | +reload: |
| 39 | + |
| 40 | +assert-css: (".item-table .mod", {"color": "rgb(210, 153, 29)"}, ALL) |
| 41 | +assert-css: (".item-table .macro", {"color": "rgb(9, 189, 0)"}, ALL) |
| 42 | +assert-css: (".item-table .struct", {"color": "rgb(45, 191, 184)"}, ALL) |
| 43 | +assert-css: (".item-table .enum", {"color": "rgb(45, 191, 184)"}, ALL) |
| 44 | +assert-css: (".item-table .trait", {"color": "rgb(183, 140, 242)"}, ALL) |
| 45 | +assert-css: (".item-table .fn", {"color": "rgb(43, 171, 99)"}, ALL) |
| 46 | +assert-css: (".item-table .type", {"color": "rgb(45, 191, 184)"}, ALL) |
| 47 | +assert-css: (".item-table .union", {"color": "rgb(45, 191, 184)"}, ALL) |
| 48 | +assert-css: (".item-table .keyword", {"color": "rgb(210, 153, 29)"}, ALL) |
| 49 | + |
| 50 | +assert-css: ( |
| 51 | + ".sidebar-elems a:not(.current)", |
| 52 | + {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"}, |
| 53 | + ALL, |
| 54 | +) |
| 55 | +assert-css: ( |
| 56 | + ".sidebar-elems a.current", |
| 57 | + {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)", "font-weight": "500"}, |
| 58 | + ALL, |
| 59 | +) |
| 60 | + |
| 61 | + |
| 62 | +// Light theme |
| 63 | +local-storage: {"rustdoc-theme": "light"} |
| 64 | +reload: |
| 65 | + |
| 66 | +assert-css: (".item-table .mod", {"color": "rgb(56, 115, 173)"}, ALL) |
| 67 | +assert-css: (".item-table .macro", {"color": "rgb(6, 128, 0)"}, ALL) |
| 68 | +assert-css: (".item-table .struct", {"color": "rgb(173, 55, 138)"}, ALL) |
| 69 | +assert-css: (".item-table .enum", {"color": "rgb(173, 55, 138)"}, ALL) |
| 70 | +assert-css: (".item-table .trait", {"color": "rgb(110, 79, 201)"}, ALL) |
| 71 | +assert-css: (".item-table .fn", {"color": "rgb(173, 124, 55)"}, ALL) |
| 72 | +assert-css: (".item-table .type", {"color": "rgb(173, 55, 138)"}, ALL) |
| 73 | +assert-css: (".item-table .union", {"color": "rgb(173, 55, 138)"}, ALL) |
| 74 | +assert-css: (".item-table .keyword", {"color": "rgb(56, 115, 173)"}, ALL) |
| 75 | + |
| 76 | +assert-css: ( |
| 77 | + ".sidebar-elems a:not(.current)", |
| 78 | + {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"}, |
| 79 | + ALL, |
| 80 | +) |
| 81 | +assert-css: ( |
| 82 | + ".sidebar-elems a.current", |
| 83 | + {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)", "font-weight": "500"}, |
| 84 | + ALL, |
| 85 | +) |
0 commit comments