Theme: Improve default theme styling

Changes tooltip to use the ui-widget-shadow class, which now applies the
box-shadow style. .ui-widget-shadow was created when box-shadow wasn't
available. By now, there's no point in faking a custom shadow anymore.
This removes the only non-structural CSS from a widget-specific file.

Updates demos to use the same font-family, removes unused images.

Will be available as the new default theme on ThemeRoller called "Base",
while "UI Smoothness" and "UI Lightness" will still be available in the
gallery.

Fixes #10617
Fixes #10880
Closes gh-1436
Ref jquery/download.jqueryui.com#248
This commit is contained in:
Jasper de Groot 2014-11-07 10:43:32 +01:00 committed by Jörn Zaefferer
parent 0aa4e989ef
commit 79c4fa1e7a
22 changed files with 48 additions and 53 deletions

View File

@ -1,5 +1,5 @@
body { body {
font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"; font-family: Arial, Helvetica, sans-serif;
} }
table { table {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -15,7 +15,7 @@
/* Component containers /* Component containers
----------------------------------*/ ----------------------------------*/
.ui-widget { .ui-widget {
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-family: Arial,Helvetica,sans-serif/*{ffDefault}*/;
font-size: 1em/*{fsDefault}*/; font-size: 1em/*{fsDefault}*/;
} }
.ui-widget .ui-widget { .ui-widget .ui-widget {
@ -25,25 +25,25 @@
.ui-widget select, .ui-widget select,
.ui-widget textarea, .ui-widget textarea,
.ui-widget button { .ui-widget button {
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-family: Arial,Helvetica,sans-serif/*{ffDefault}*/;
font-size: 1em; font-size: 1em;
} }
.ui-widget-content { .ui-widget-content {
border: 1px solid #aaaaaa/*{borderColorContent}*/; border: 1px solid #dddddd/*{borderColorContent}*/;
background: #ffffff/*{bgColorContent}*/ url("images/ui-bg_flat_75_ffffff_40x100.png")/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; background: #ffffff/*{bgColorContent}*/ /*{bgImgUrlContent}*/ /*{bgContentXPos}*/ /*{bgContentYPos}*/ /*{bgContentRepeat}*/;
color: #222222/*{fcContent}*/; color: #333333/*{fcContent}*/;
} }
.ui-widget-content a { .ui-widget-content a {
color: #222222/*{fcContent}*/; color: #333333/*{fcContent}*/;
} }
.ui-widget-header { .ui-widget-header {
border: 1px solid #aaaaaa/*{borderColorHeader}*/; border: 1px solid #dddddd/*{borderColorHeader}*/;
background: #cccccc/*{bgColorHeader}*/ url("images/ui-bg_highlight-soft_75_cccccc_1x100.png")/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; background: #e9e9e9/*{bgColorHeader}*/ /*{bgImgUrlHeader}*/ /*{bgHeaderXPos}*/ /*{bgHeaderYPos}*/ /*{bgHeaderRepeat}*/;
color: #222222/*{fcHeader}*/; color: #333333/*{fcHeader}*/;
font-weight: bold; font-weight: bold;
} }
.ui-widget-header a { .ui-widget-header a {
color: #222222/*{fcHeader}*/; color: #333333/*{fcHeader}*/;
} }
/* Interaction states /* Interaction states
@ -51,15 +51,15 @@
.ui-state-default, .ui-state-default,
.ui-widget-content .ui-state-default, .ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default { .ui-widget-header .ui-state-default {
border: 1px solid #d3d3d3/*{borderColorDefault}*/; border: 1px solid #c5c5c5/*{borderColorDefault}*/;
background: #e6e6e6/*{bgColorDefault}*/ url("images/ui-bg_glass_75_e6e6e6_1x400.png")/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; background: #f6f6f6/*{bgColorDefault}*/ /*{bgImgUrlDefault}*/ /*{bgDefaultXPos}*/ /*{bgDefaultYPos}*/ /*{bgDefaultRepeat}*/;
font-weight: normal/*{fwDefault}*/; font-weight: normal/*{fwDefault}*/;
color: #555555/*{fcDefault}*/; color: #454545/*{fcDefault}*/;
} }
.ui-state-default a, .ui-state-default a,
.ui-state-default a:link, .ui-state-default a:link,
.ui-state-default a:visited { .ui-state-default a:visited {
color: #555555/*{fcDefault}*/; color: #454545/*{fcDefault}*/;
text-decoration: none; text-decoration: none;
} }
.ui-state-hover, .ui-state-hover,
@ -68,10 +68,10 @@
.ui-state-focus, .ui-state-focus,
.ui-widget-content .ui-state-focus, .ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus { .ui-widget-header .ui-state-focus {
border: 1px solid #999999/*{borderColorHover}*/; border: 1px solid #cccccc/*{borderColorHover}*/;
background: #dadada/*{bgColorHover}*/ url("images/ui-bg_glass_75_dadada_1x400.png")/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; background: #ededed/*{bgColorHover}*/ /*{bgImgUrlHover}*/ /*{bgHoverXPos}*/ /*{bgHoverYPos}*/ /*{bgHoverRepeat}*/;
font-weight: normal/*{fwDefault}*/; font-weight: normal/*{fwDefault}*/;
color: #212121/*{fcHover}*/; color: #2b2b2b/*{fcHover}*/;
} }
.ui-state-hover a, .ui-state-hover a,
.ui-state-hover a:hover, .ui-state-hover a:hover,
@ -81,21 +81,21 @@
.ui-state-focus a:hover, .ui-state-focus a:hover,
.ui-state-focus a:link, .ui-state-focus a:link,
.ui-state-focus a:visited { .ui-state-focus a:visited {
color: #212121/*{fcHover}*/; color: #2b2b2b/*{fcHover}*/;
text-decoration: none; text-decoration: none;
} }
.ui-state-active, .ui-state-active,
.ui-widget-content .ui-state-active, .ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active { .ui-widget-header .ui-state-active {
border: 1px solid #aaaaaa/*{borderColorActive}*/; border: 1px solid #003eff/*{borderColorActive}*/;
background: #ffffff/*{bgColorActive}*/ url("images/ui-bg_glass_65_ffffff_1x400.png")/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; background: #007fff/*{bgColorActive}*/ /*{bgImgUrlActive}*/ /*{bgActiveXPos}*/ /*{bgActiveYPos}*/ /*{bgActiveRepeat}*/;
font-weight: normal/*{fwDefault}*/; font-weight: normal/*{fwDefault}*/;
color: #212121/*{fcActive}*/; color: #ffffff/*{fcActive}*/;
} }
.ui-state-active a, .ui-state-active a,
.ui-state-active a:link, .ui-state-active a:link,
.ui-state-active a:visited { .ui-state-active a:visited {
color: #212121/*{fcActive}*/; color: #ffffff/*{fcActive}*/;
text-decoration: none; text-decoration: none;
} }
@ -104,31 +104,31 @@
.ui-state-highlight, .ui-state-highlight,
.ui-widget-content .ui-state-highlight, .ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight { .ui-widget-header .ui-state-highlight {
border: 1px solid #fcefa1/*{borderColorHighlight}*/; border: 1px solid #dad55e/*{borderColorHighlight}*/;
background: #fbf9ee/*{bgColorHighlight}*/ url("images/ui-bg_glass_55_fbf9ee_1x400.png")/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; background: #fffa90/*{bgColorHighlight}*/ /*{bgImgUrlHighlight}*/ /*{bgHighlightXPos}*/ /*{bgHighlightYPos}*/ /*{bgHighlightRepeat}*/;
color: #363636/*{fcHighlight}*/; color: #777620/*{fcHighlight}*/;
} }
.ui-state-highlight a, .ui-state-highlight a,
.ui-widget-content .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,
.ui-widget-header .ui-state-highlight a { .ui-widget-header .ui-state-highlight a {
color: #363636/*{fcHighlight}*/; color: #777620/*{fcHighlight}*/;
} }
.ui-state-error, .ui-state-error,
.ui-widget-content .ui-state-error, .ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error { .ui-widget-header .ui-state-error {
border: 1px solid #cd0a0a/*{borderColorError}*/; border: 1px solid #f1a899/*{borderColorError}*/;
background: #fef1ec/*{bgColorError}*/ url("images/ui-bg_glass_95_fef1ec_1x400.png")/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; background: #fddfdf/*{bgColorError}*/ /*{bgImgUrlError}*/ /*{bgErrorXPos}*/ /*{bgErrorYPos}*/ /*{bgErrorRepeat}*/;
color: #cd0a0a/*{fcError}*/; color: #5f3f3f/*{fcError}*/;
} }
.ui-state-error a, .ui-state-error a,
.ui-widget-content .ui-state-error a, .ui-widget-content .ui-state-error a,
.ui-widget-header .ui-state-error a { .ui-widget-header .ui-state-error a {
color: #cd0a0a/*{fcError}*/; color: #5f3f3f/*{fcError}*/;
} }
.ui-state-error-text, .ui-state-error-text,
.ui-widget-content .ui-state-error-text, .ui-widget-content .ui-state-error-text,
.ui-widget-header .ui-state-error-text { .ui-widget-header .ui-state-error-text {
color: #cd0a0a/*{fcError}*/; color: #5f3f3f/*{fcError}*/;
} }
.ui-priority-primary, .ui-priority-primary,
.ui-widget-content .ui-priority-primary, .ui-widget-content .ui-priority-primary,
@ -163,27 +163,27 @@
} }
.ui-icon, .ui-icon,
.ui-widget-content .ui-icon { .ui-widget-content .ui-icon {
background-image: url("images/ui-icons_222222_256x240.png")/*{iconsContent}*/; background-image: url("images/ui-icons_444444_256x240.png")/*{iconsContent}*/;
} }
.ui-widget-header .ui-icon { .ui-widget-header .ui-icon {
background-image: url("images/ui-icons_222222_256x240.png")/*{iconsHeader}*/; background-image: url("images/ui-icons_444444_256x240.png")/*{iconsHeader}*/;
} }
.ui-state-default .ui-icon { .ui-state-default .ui-icon {
background-image: url("images/ui-icons_888888_256x240.png")/*{iconsDefault}*/; background-image: url("images/ui-icons_777777_256x240.png")/*{iconsDefault}*/;
} }
.ui-state-hover .ui-icon, .ui-state-hover .ui-icon,
.ui-state-focus .ui-icon { .ui-state-focus .ui-icon {
background-image: url("images/ui-icons_454545_256x240.png")/*{iconsHover}*/; background-image: url("images/ui-icons_555555_256x240.png")/*{iconsHover}*/;
} }
.ui-state-active .ui-icon { .ui-state-active .ui-icon {
background-image: url("images/ui-icons_454545_256x240.png")/*{iconsActive}*/; background-image: url("images/ui-icons_ffffff_256x240.png")/*{iconsActive}*/;
} }
.ui-state-highlight .ui-icon { .ui-state-highlight .ui-icon {
background-image: url("images/ui-icons_2e83ff_256x240.png")/*{iconsHighlight}*/; background-image: url("images/ui-icons_777620_256x240.png")/*{iconsHighlight}*/;
} }
.ui-state-error .ui-icon, .ui-state-error .ui-icon,
.ui-state-error-text .ui-icon { .ui-state-error-text .ui-icon {
background-image: url("images/ui-icons_cd0a0a_256x240.png")/*{iconsError}*/; background-image: url("images/ui-icons_cc0000_256x240.png")/*{iconsError}*/;
} }
/* positioning */ /* positioning */
@ -373,38 +373,34 @@
.ui-corner-top, .ui-corner-top,
.ui-corner-left, .ui-corner-left,
.ui-corner-tl { .ui-corner-tl {
border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 3px/*{cornerRadius}*/;
} }
.ui-corner-all, .ui-corner-all,
.ui-corner-top, .ui-corner-top,
.ui-corner-right, .ui-corner-right,
.ui-corner-tr { .ui-corner-tr {
border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 3px/*{cornerRadius}*/;
} }
.ui-corner-all, .ui-corner-all,
.ui-corner-bottom, .ui-corner-bottom,
.ui-corner-left, .ui-corner-left,
.ui-corner-bl { .ui-corner-bl {
border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 3px/*{cornerRadius}*/;
} }
.ui-corner-all, .ui-corner-all,
.ui-corner-bottom, .ui-corner-bottom,
.ui-corner-right, .ui-corner-right,
.ui-corner-br { .ui-corner-br {
border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 3px/*{cornerRadius}*/;
} }
/* Overlays */ /* Overlays */
.ui-widget-overlay { .ui-widget-overlay {
background: #aaaaaa/*{bgColorOverlay}*/ url("images/ui-bg_flat_0_aaaaaa_40x100.png")/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; background: #aaaaaa/*{bgColorOverlay}*/;
opacity: .3/*{opacityOverlay}*/; opacity: .3/*{opacityOverlay}*/;
filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/; /* support: IE8 */ filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/; /* support: IE8 */
} }
.ui-widget-shadow { .ui-widget-shadow {
margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; -webkit-box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/;
padding: 8px/*{thicknessShadow}*/; box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/;
background: #aaaaaa/*{bgColorShadow}*/ url("images/ui-bg_flat_0_aaaaaa_40x100.png")/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/;
opacity: .3/*{opacityShadow}*/;
filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/; /* support: IE8 */
border-radius: 8px/*{cornerRadiusShadow}*/;
} }

View File

@ -13,8 +13,6 @@
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
max-width: 300px; max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
} }
body .ui-tooltip { body .ui-tooltip {
border-width: 2px; border-width: 2px;

View File

@ -406,7 +406,8 @@ return $.widget( "ui.tooltip", {
_tooltip: function( element ) { _tooltip: function( element ) {
var tooltip = $( "<div>" ) var tooltip = $( "<div>" )
.attr( "role", "tooltip" ) .attr( "role", "tooltip" )
.addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " + // TODO move to classes option
.addClass( "ui-tooltip ui-widget ui-widget-shadow ui-corner-all ui-widget-content " +
( this.options.tooltipClass || "" ) ), ( this.options.tooltipClass || "" ) ),
id = tooltip.uniqueId().attr( "id" ); id = tooltip.uniqueId().attr( "id" );