SpecialPreferences: Make save button bar sticky
authorEd Sanders <esanders@wikimedia.org>
Tue, 6 Nov 2018 13:31:47 +0000 (13:31 +0000)
committerVolker E <volker.e@wikimedia.org>
Tue, 27 Nov 2018 20:19:31 +0000 (12:19 -0800)
Enable `position: sticky` on preferences buttons and degrade
gracefully in unsupported browsers, where this results in no
change.

Bug: T205866
Change-Id: Ic98a9d94d3136a4003370cf0e2a8efb7ae1a3f38

resources/src/mediawiki.special.preferences.styles.ooui.less

index 6f91ad2..b1931f4 100644 (file)
 .mw-email-authenticated .oo-ui-labelWidget { }
 */
 
+/*
+ * Use `position: sticky` on supported browsers, degrades gracefully in
+ * all others, therefore no `@supports` feature query to reduce code complexity.
+ */
+.mw-prefs-buttons {
+       background-color: #fff;
+       position: -webkit-sticky;
+       position: sticky;
+       bottom: 0;
+       margin-top: -1px;
+       border-top: 1px solid #c8ccd1;
+       padding: 1em 0;
+}
+
 /* This is needed because add extra buttons in a weird way */
 .mw-prefs-buttons .mw-htmlform-submit-buttons {
        display: inline;
        margin: 0;
 }
 
-.mw-prefs-buttons {
-       margin-top: 1em;
-}
-
 #prefcontrol {
        margin-right: 0.5em;
 }