diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 81c12be8e83c0..12059e0b9c4b5 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1401,6 +1401,18 @@ pre.rust {
cursor: pointer;
}
+@keyframes rotating {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
+#settings-menu.rotate img {
+ animation: rotating 2s linear infinite;
+}
+
#help-button {
font-family: "Fira Sans", Arial, sans-serif;
text-align: center;
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index 667f89c07e212..e8edd5f2d2339 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -301,6 +301,7 @@ function loadCss(cssFileName) {
}
getSettingsButton().onclick = event => {
+ addClass(getSettingsButton(), "rotate");
event.preventDefault();
loadScript(window.settingsJS);
};
diff --git a/src/librustdoc/html/static/js/settings.js b/src/librustdoc/html/static/js/settings.js
index 119d4b07665a4..d1526270f30f1 100644
--- a/src/librustdoc/html/static/js/settings.js
+++ b/src/librustdoc/html/static/js/settings.js
@@ -274,5 +274,6 @@
if (!isSettingsPage) {
switchDisplayedElement(settingsMenu);
}
+ removeClass(getSettingsButton(), "rotate");
}, 0);
})();