diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-09 22:31:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-09 22:31:58 +0100 |
| commit | d0563c64b8264e55b130c2fe7044b37daf6d91b0 (patch) | |
| tree | f7a9d6bd6c86ffeaf8606e9166e24428ca09bc26 /src/test | |
| parent | f78babd6c480266996d6cbfde747600fcf73cf09 (diff) | |
| parent | d60967bef29b4b9ad5c145f216a582da28b22505 (diff) | |
| download | rust-d0563c64b8264e55b130c2fe7044b37daf6d91b0.tar.gz rust-d0563c64b8264e55b130c2fe7044b37daf6d91b0.zip | |
Rollup merge of #105504 - notriddle:notriddle/stab-css, r=GuillaumeGomez
rustdoc: make stability badge CSS more consistent # Before   # After   # Description * They all get rounded corners now. A test case has been added for this, too. * There are now broadly two kinds of stability badge, where there used to be three: item-info "fat badge", and the "thin badge" in both item tables and in docblocks (which got merged). The fat badges can have icons, while the thin badges can't. * The old Ayu design doesn't make sense to me. Does anyone know why it was done that way?
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc-gui/stab-badge.goml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/stab-badge.goml b/src/test/rustdoc-gui/stab-badge.goml new file mode 100644 index 00000000000..aaed8440a40 --- /dev/null +++ b/src/test/rustdoc-gui/stab-badge.goml @@ -0,0 +1,41 @@ +// All stability badges should have rounded corners and colored backgrounds. +goto: "file://" + |DOC_PATH| + "/test_docs/index.html" +show-text: true +define-function: ( + "check-badge", + (theme, background, color), + [ + ("local-storage", {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}), + ("goto", "file://" + |DOC_PATH| + "/test_docs/index.html"), + ("assert", (".docblock .stab")), + ("assert", (".item-table .stab")), + ("assert-css", (".stab", { + "border-radius": "3px", + "color": |color|, + "background-color": |background|, + })), + ("goto", "file://" + |DOC_PATH| + "/test_docs/fn.replaced_function.html"), + ("assert", (".item-info .stab")), + ("assert-css", (".stab", { + "border-radius": "3px", + "color": |color|, + "background-color": |background|, + })), + ] +) + +call-function: ("check-badge", { + "theme": "ayu", + "color": "rgb(197, 197, 197)", + "background": "rgb(49, 69, 89)", +}) +call-function: ("check-badge", { + "theme": "dark", + "color": "rgb(221, 221, 221)", + "background": "rgb(49, 69, 89)", +}) +call-function: ("check-badge", { + "theme": "light", + "color": "rgb(0, 0, 0)", + "background": "rgb(255, 245, 214)", +}) |
