Permalink
Browse files

Fixed 5254: Input, button and anchor buttons aren't consistent in IE7…

…. They really weren't consistent in any browser. Now they are.
  • Loading branch information...
davidmurdoch committed May 13, 2011
1 parent 1845015 commit 114b5416b93a4b250174803c8d734e588adb7783
Showing with 18 additions and 4 deletions.
  1. +1 −1 tests/visual/button/button_ticket_5254.html
  2. +17 −3 themes/base/jquery.ui.button.css
@@ -52,4 +52,4 @@ <h3 id="ua"></h3>
</dl>
</body>
-</html>
+</html>
@@ -7,21 +7,27 @@
*
* http://docs.jquery.com/UI/Button#theming
*/
-.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+
+/* the overflow property removes extra width in IE */
+/* margins need to be reset. In some browsers "button", and "input" have margins by default but anchors do not*/
+/* vertical-align:middle is required to align anchors with their input and button brothers */
+.ui-button { display: inline-block; position: relative; padding: 0; margin:0 .3em 0 0; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; vertical-align: middle; }
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
-.ui-button-text-only .ui-button-text { padding: .4em 1em; }
+.ui-button-text-only .ui-button-text { padding: .38em 1em .37em; padding: .36em 1em\0/; }
+
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+
/* no icon support for input elements, provide padding by default */
-input.ui-button { padding: .4em 1em; }
+input.ui-button { padding: .46em 1em; }
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
@@ -36,3 +42,11 @@ input.ui-button { padding: .4em 1em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+@-moz-document url-prefix() {
+ input.ui-button { padding: .43em .71em; } /* reset extra padding in Firefox */
+}
+a.ui-button-text-only .ui-button-text { padding: .46em 1.1em .56em !ie; } /* IE<8 needs some extra love to style anchors correctly */
+input.ui-button { margin-right: .34em !ie; padding-top:.47em\0/; } /* IE6,7 need help with margins and IE8 doesnt treat our em padding correctly */
+@media all and (min-width:0) {
+ input.ui-button { padding-top:.45em\0/; } /* IE9 is also a bit odd */
+}

0 comments on commit 114b541

Please sign in to comment.