Nirzar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/216864

Change subject: Changing the default padding for buttonWidget + absolute icons
......................................................................

Changing the default padding for buttonWidget + absolute icons

This patch changes the way the button height is calculated in OOJS UI and 
matches it with MediaWiki UI
Bug: T91473

Change-Id: I8d0604320dbbc6008797ff000e3b39e151915fbd
---
M src/themes/mediawiki/elements.less
M src/themes/mediawiki/widgets.less
2 files changed, 26 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/64/216864/1

diff --git a/src/themes/mediawiki/elements.less 
b/src/themes/mediawiki/elements.less
index 535c025..205addd 100644
--- a/src/themes/mediawiki/elements.less
+++ b/src/themes/mediawiki/elements.less
@@ -85,11 +85,18 @@
        }
 
        &-framed {
+               &.oo-ui-iconElement.oo-ui-labelElement, 
&.oo-ui-iconElement.oo-ui-indicatorElement {
+                       > .oo-ui-buttonElement-button{
+                               padding-left: 2.4em;
+                       }
+               }
                > .oo-ui-buttonElement-button {
                        margin: 0.1em 0;
-                       padding: 0.2em 0.8em;
+                       padding: 0.5em 1em;
+                       min-height: 1.2em;
+                       min-width: 1em;
                        border-radius: @border-radius;
-
+                       position: relative;
                        &:hover,
                        &:focus {
                                outline: none;
@@ -105,13 +112,18 @@
                // Support <input/> from ButtonInputWidget
                > input.oo-ui-buttonElement-button,
                &.oo-ui-labelElement > .oo-ui-buttonElement-button > 
.oo-ui-labelElement-label {
-                       line-height: @icon-size;
-               }
+                       line-height: 1.2em;
+                       display: table-cell;
+        }
 
                &.oo-ui-iconElement {
                        > .oo-ui-buttonElement-button > .oo-ui-iconElement-icon 
{
                                margin-left: -0.5em;
                                margin-right: -0.5em;
+                               display: table-cell;
+                               position: absolute;
+                               top:0.2em;
+                               left: 1em;
                        }
 
                        &.oo-ui-labelElement > .oo-ui-buttonElement-button > 
.oo-ui-iconElement-icon {
@@ -124,14 +136,23 @@
                                /* -0.5 - 0.475 */
                                margin-left: -0.005em;
                                margin-right: -0.005em;
+                               display: table-cell;
+                               opacity: 0.5;
                        }
+            
 
                        &.oo-ui-labelElement > .oo-ui-buttonElement-button > 
.oo-ui-indicatorElement-indicator,
                        &.oo-ui-iconElement:not( .oo-ui-labelElement ) > 
.oo-ui-buttonElement-button > .oo-ui-indicatorElement-indicator {
                                margin-left: @indicator-size / 2;
                                margin-right: -0.275em;
                        }
-               }
+                       &.oo-ui-labelElement {
+                               > .oo-ui-buttonElement-button > 
.oo-ui-indicatorElement-indicator {
+                               position: relative;
+                               left: 0.2em;
+                               }
+                       }
+        }
 
                &.oo-ui-widget-disabled > .oo-ui-buttonElement-button {
                        color: @disabled-framed-text;
diff --git a/src/themes/mediawiki/widgets.less 
b/src/themes/mediawiki/widgets.less
index d2e3ee9..0702c6d 100644
--- a/src/themes/mediawiki/widgets.less
+++ b/src/themes/mediawiki/widgets.less
@@ -704,10 +704,6 @@
        padding: 0;
        background-color: transparent;
 
-       .oo-ui-buttonElement-button {
-               height: @icon-size;
-       }
-
        &.oo-ui-iconElement .oo-ui-iconElement-icon {
                margin-top: 0;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/216864
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d0604320dbbc6008797ff000e3b39e151915fbd
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Nirzar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to