Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/visual/button/button_ticket_5254.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ <h3 id="ua"></h3>
</dl>

</body>
</html>
</html>
19 changes: 16 additions & 3 deletions themes/base/jquery.ui.button.css
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -36,3 +42,10 @@ 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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need two different moz specific hacks? Or in other words, can't you use ::-moz-focus-inner or the moz-document thingy for both of these?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe ::-moz-focus-inner acts similarly to ::after and ::before in that the CSS rules don't apply to the element itself, but some psudeo element, instead. So, -moz-focus-inner isn't really a hack...it is modifying the focus "ring" in firefox (http://stackoverflow.com/questions/71074/how-to-remove-firefoxs-dotted-outline-on-buttons-as-well-as-links)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sounded like I wasn't sure about '-moz-document url-prefix()' so I just want to make it clear that I am positive about what I said in my previous statement. :-)

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/ie8+9; } /* IE6,7 need help with margins and IE8 doesnt treat our em padding correctly */

input.ui-button { padding-top:.45em \0/ie9; } /* IE9 is also a bit odd */