View
 

Shadow

Page history last edited by Jörn Zaefferer 2 years, 7 months ago

 

type: utility

release: 0.0

priority: high

status: in planning

documentation: url || N/A

demo: url || N/A

 


 

1 - Description:

 

This utility is used to create a styled, semi-transparent layer under a DOM element or widget to create the illusion of a dropshadow without the need for images. There are levers in the CSS framework and ThemeRoller tool to support the definition of the shadow's apearance: thickness, offset, texture, color, opacity.

 

A version of this was written for 1.7, but pulled for performance issues (need link to demo and specs from Paul). An example of the shadow can be seen int eh static mockup on the ThemeRoller page:

http://jqueryui.com/themeroller/

 

 

 


 

2 - Visual Design:

 

(Initial wireframe mockup, followed by more detailed designs of the various configurations, options and states.)

 


 

 

3 - Functional Specifications/Requirements:

 

  • The shadow can be called on any dom element or widget
  • The shadow must be automatically protected by default with the stackfix utility to avoid z-index issues
  • Sized to the same dimensions as the calling element
  • Positioned directly under the calling element
  • The ui-widget-shadow class must be applied to the shadow
    • This class will apply padding and offsets to achieve the theme's shadow style
    • No colors, opacity or other attibutes that will interfere with the theming rules should be written by this plugin

 


 

4 - Markup & Style:

 

     4.1 Initial markup examples

 

     (Pre-enhanced HTML markup structure that will be transformed into the final widget. There may be multiple possible HTML markup options per widget: for example, for a slider, radiobuttons, inputs or selects could all be used. )

 

     4.2 Recommended transformed HTML markup

 

     (The HTML markup structure and classes that will be used by the scripts in the enhanced version) 

 

     4.3 Accessibility recommendation

 

    (Detailed recommendations for ARIA, HTML markup, CSS and javascript that will contribute to universal access and full section 508 accessibility for screen readers, mobile devices and any other devices) 

 

     4.4 CSS & Theme

 

    (Description of the CSS classes to be used for all states, how custom theming and Themeroller support will work.) 

 


 

5 - Latest version of plugin:

 

(Link to the latest version in the jQuery UI trunk here)

 


 

6 - Open issues being discussed

 

(Use this area to place things that we're hashing out like features and options we're not sure we should include, questions about how this fits into UI and relates to other widgets and utilities, known problems, whether features should be broken across multiple releases, etc.)

 


 

 

 

 

Comments (8)

Jörn Zaefferer said

at 5:40 am on Jul 8, 2009

Why did we make this a high priority...?

Anyway, it says Paul had a prototype, but there is nothing in dev or labs. Paul, is there anything worth reusing? In any case, it would be good to know what your approach was and what the performance issue was.

Scott González said

at 8:14 am on Jul 8, 2009

The code would live in an old revision of dialog, probably somewhere between 1.6rc5 and 1.7.

Jörn Zaefferer said

at 2:02 pm on Jul 23, 2009

The shadow code was removed in revision 2013, so revisions before that, eg. 2012, still have it. Seems to boil down to calls to these three methods:

_createShadow: function() {
this.shadow = $('<div class="ui-widget-shadow"></div>').css('position', 'absolute').appendTo(document.body);
this._refreshShadow();
return this.shadow;
},

_refreshShadow: function() {
if (!this.options.shadow) { return; }

var uiDialog = this.uiDialog,
offset = uiDialog.offset();
this.shadow.css({
left: offset.left,
top: offset.top,
width: uiDialog.outerWidth(),
height: uiDialog.outerHeight()
});
},

_destroyShadow: function() {
this.shadow.remove();
this.shadow = null;
}

Jörn Zaefferer said

at 2:05 pm on Jul 23, 2009

More forensics:

The commit comment says it reopens #3681 http://dev.jqueryui.com/ticket/3681

Which links to r1814, where shadow was first implemented: http://dev.jqueryui.com/changeset/1814

MiD-AwE said

at 8:51 pm on May 28, 2010

It seems that shadow is at a stalemate. Why not allow the CSS box-shadow for now with future versions to include the under-layer?

Kevin Peno said

at 6:02 pm on Nov 30, 2010

Why do we need more than box-shadow anyway? It seems that this request is simply trying to bring shadow cross browser. Other than that, what benefits does it have over, say, css styling? My vote is to leave this to stylesheets.

MiD-AwE said

at 9:39 am on Dec 10, 2010

I've made it my practice to either override the UI definition with a box-shadow statement or simply amend my custom.css with box-shadow defined. I do understand why this was not changed, since w3c had removed box-shadow from the CSS3 working draft and in may added it back. Although, there is no reason that I can see why an identical effect to the current jQueryUI shadow can not be accomplished with CSS3 border-image and could be "ThemeRoller Ready", IMHO. I'm not sure how that could be done for non-CSS3 browsers.

Marcus Tucker said

at 9:45 am on Dec 10, 2010

RE: CSS3 for non-CSS3 browsers

For IE 6-8 there's http://css3pie.com

You don't have permission to comment on this page.