SlideShare ist ein Scribd-Unternehmen logo
1 von 83
Downloaden Sie, um offline zu lesen
jQuery,
eCSStender
& you
Aaron Gustafson
Easy Designs, LLC
slideshare.net/AaronGustafson
?
?
jQuery, eCSStender & you




Download...




                           eCSStender.org
DevChatt - June 2011                        12
jQuery, eCSStender & you




Download...




                           eCSStender.org
DevChatt - June 2011                        13
jQuery, eCSStender & you




Download...




                           github.com/easy-designs/eCSStender.js
DevChatt - June 2011                                               14
jQuery, eCSStender & you




...collect extensions...




DevChatt - June 2011       15
jQuery, eCSStender & you




...collect extensions...




DevChatt - June 2011       16
jQuery, eCSStender & you




...include...
   <script       type="text/javascript"   src="eCSStender.js"></script>
   <script       type="text/javascript"   src="eCSStender.CSS3-backgrounds-and-borders.js"></script>
   <script       type="text/javascript"   src="eCSStender.CSS3-transforms.js"></script>
   <script       type="text/javascript"   src="eCSStender.CSS3-color.js"></script>
   <script       type="text/javascript"   src="eCSStender.CSS3-transitions.js"></script>




DevChatt - June 2011                                                                                   17
jQuery, eCSStender & you




...and write your CSS
   section,
   article,
   blockquote {
     border-radius: 10px;
     box-shadow: 0 0 15px 1px #000;
     color: rgb(255, 255, 255);
     transform-origin: 50% 50%;
     transition: all 0.5s linear;
   }
   section:hover,
   body:focus section,
   section:hover blockquote,
   body:focus blockquote {
     transform: rotate(-15deg);
   }
   section:hover article,
   body:focus article {
     transform: rotate(30deg);
   }




DevChatt - June 2011                  18
jQuery, eCSStender & you




Need selectors?
   <script type="text/javascript" src="eCSStender.js"></script>
   <script type="text/javascript" src="sizzle.js"></script>
   <script type="text/javascript">
     // <![CDATA[
     eCSStender.addMethod('findBySelector',Sizzle);
     // ]]>
   </script>
   <script type="text/javascript" src="eCSStender.CSS3-selectors.js"></script>




DevChatt - June 2011                                                             20
jQuery, eCSStender & you




Compound classes in IE6?
   p.test {
     color: green;
   }
   p.alt.test {
     color: red;
   }




DevChatt - June 2011       21
jQuery, eCSStender & you




Adjacent siblings?
   p + p {
     color: green;
   }




DevChatt - June 2011       22
jQuery, eCSStender & you




General siblings?
   p ~ p {
     color: green;
   }




DevChatt - June 2011       23
jQuery, eCSStender & you




Advanced pseudo-classes?
   tr {
     background: white;
   }
   td:empty {
     background: green;
   }




DevChatt - June 2011       24
jQuery, eCSStender & you




Consider border-radius
   #foo {
     border-radius: 3px;
   }




DevChatt - June 2011       26
jQuery, eCSStender & you




Consider border-radius
   #foo {
     -moz-border-radius: 3px;
     -webkit-border-radius: 3px;
     -o-border-radius: 3px;
     -khtml-border-radius: 3px;
     border-radius: 3px;
   }




DevChatt - June 2011               27
jQuery, eCSStender & you




Consider border-radius
   #foo {
     border-radius: 10px 5px;
   }




DevChatt - June 2011            28
jQuery, eCSStender & you




Consider border-radius
   #foo {
     -moz-border-radius: 10px 5px;
     -webkit-border-top-left-radius: 10px;
     -webkit-border-top-right-radius: 5px;
     -webkit-border-bottom-right-radius: 10px;
     -webkit-border-bottom-left-radius: 10px;
     -o-border-radius: 10px 5px;
     -khtml-border-top-left-radius: 10px;
     -khtml-border-top-right-radius: 5px;
     -khtml-border-bottom-right-radius: 10px;
     -khtml-border-bottom-left-radius: 10px;
     border-radius: 10px 5px;
   }




DevChatt - June 2011                             29
jQuery, eCSStender & you




Ah, memories...
   #foo {
     padding: 10px;
     width: 200px;
     width: 180px;
     height: 200px;
     height: 180px;
   }

   /* or */

   #foo {
     padding: 10px;
     width: 200px;
     height: 200px;
   }
   * html #foo {
     width: 180px;
     height: 180px;
   }




DevChatt - June 2011       30
jQuery, eCSStender & you




Simpli ed CSS3?
   <script       type="text/javascript"   src="eCSStender.js"></script>
   <script       type="text/javascript"   src="eCSStender.CSS3-backgrounds-and-borders.js"></script>
   <script       type="text/javascript"   src="eCSStender.CSS3-transforms.js"></script>
   <script       type="text/javascript"   src="eCSStender.CSS3-color.js"></script>
   <script       type="text/javascript"   src="eCSStender.CSS3-transitions.js"></script>




DevChatt - June 2011                                                                                   31
jQuery, eCSStender & you




Yup!
  section,
  article,
  blockquote {
    border-radius: 10px;
    box-shadow: 0 0 15px 1px #000;
    color: rgb(255, 255, 255);
    transform-origin: 50% 50%;
    transition: all 0.5s linear;
  }
  section:hover,
  body:focus section,
  section:hover blockquote,
  body:focus blockquote {
    transform: rotate(-15deg);
  }
  section:hover article,
  body:focus article {
    transform: rotate(30deg);
  }




DevChatt - June 2011                 32
jQuery, eCSStender & you




Yup!
  section,
  article,
  blockquote {
    border-radius: 10px;
    box-shadow: 0 0 15px 1px #000;
    color: rgb(255, 255, 255);
    transform-origin: 50% 50%;
    transition: all 0.5s linear;
  }
  section:hover,
  body:focus section,
  section:hover blockquote,
  body:focus blockquote {
    transform: rotate(-15deg);
  }
  section:hover article,
  body:focus article {
    transform: rotate(30deg);
  }




DevChatt - June 2011                 32
jQuery, eCSStender & you




Valid extension of CSS



                           -prefix-


DevChatt - June 2011                  34
jQuery, eCSStender & you




Browser vendors do it




         -moz-             -webkit-   -ms-   -o-




DevChatt - June 2011                               35
THE FUTURE OF CSS
jQuery, eCSStender & you




Pointless, but possible
   .bowling-alley img {
     -easy-physics-fill: lead;
   }
   .beach img {
     -easy-physics-fill: rubber;
   }
   .disney img {
     -easy-physics-fill: helium;
   }




DevChatt - June 2011               38
jQuery, eCSStender & you




Pointless, but possible
   .bowling-alley img {
     -easy-physics-fill: lead;
   }
   .beach img {
     -easy-physics-fill: rubber;
   }
   .disney img {
     -easy-physics-fill: helium;
   }




DevChatt - June 2011               38
jQuery, eCSStender & you




Step 1: Register extensions



                           Register




DevChatt - June 2011                  40
jQuery, eCSStender & you




Step 2: Find stylesheets


                           <html>

                             CSS    Inspect




DevChatt - June 2011                          41
jQuery, eCSStender & you




Step 3: Collect the rules



                           Collect




DevChatt - June 2011                 42
jQuery, eCSStender & you




Step 4: parse & process



                           Process




DevChatt - June 2011                 43
jQuery, eCSStender & you




Step 5: Trigger extensions




DevChatt - June 2011         44
jQuery, eCSStender & you




    Helping hands
๏   Dean Edward’s IE scripts
๏   Selectivizr
๏   css3-mediaqueries.js

                               Browser
                               Patchers




    DevChatt - June 2011                  46
jQuery, eCSStender & you




    Alternative syntax
๏   SASS (Syntactically Awesome Stylesheets)
๏   LESS (Leaner CSS)
๏   OO CSS (purely conceptual)

                                         Browser    Shorthand
                                         Patchers    Parsers




    DevChatt - June 2011                                        47
jQuery, eCSStender & you




    Capability checking
๏   Modernizr
                                          Testing
                                          Scripts



                               Browser         Shorthand
                               Patchers         Parsers




    DevChatt - June 2011                                   48
jQuery, eCSStender & you




    Something new
๏   More CSS
                                          Testing
                                          Scripts



                               Browser         Shorthand
                               Patchers         Parsers

                                          Custom
                                           CSS
                                          Parsers




    DevChatt - June 2011                                   49
jQuery, eCSStender & you




    Ecosystem
๏   jQuery plug-ins
๏   CSS Sandpaper                One-off CSS
๏   CVI scripts                scripts& libraries

                                              Testing
                                              Scripts


                                   Browser          Shorthand
                                   Patchers          Parsers

                                              Custom
                                               CSS
                                              Parsers




    DevChatt - June 2011                                        50
jQuery, eCSStender & you




Unity!
                             One-off CSS
                           scripts& libraries

                                          Testing
                                          Scripts


                               Browser          Shorthand
                               Patchers          Parsers

                                          Custom
                                           CSS
                                          Parsers




DevChatt - June 2011                                        51
Let’s make
something awesome!

       I thought you’d never ask.
jQuery, eCSStender & you




Pointless, but possible




DevChatt - June 2011       53
jQuery, eCSStender & you




Step 1: Dependencies
   <script type="text/javascript" src="eCSStender.js"></script>
   <script type="text/javascript" src="jquery.js"></script>
   <script type="text/javascript" src="jquery.EasyPhysics.js"></script>




DevChatt - June 2011                                                      54
jQuery, eCSStender & you




Step 1: Dependencies
   // jquery.EasyPhysics.js
   EasyPhysics.Balloon      = function( el   ) {
      new PhysicalObject(
         el,   // element
         0,    // velocity
         -0.5, // kinetic energy
         -0.1  // gravitational effect
      );
   };
   EasyPhysics.RubberBall = function( el     ) {
      new PhysicalObject( el, 0, -0.8, 0.5   );
   };
   EasyPhysics.BowlingBall = function( el    ) {
      new PhysicalObject( el, 1, -0.4, 0.9   );
   };




DevChatt - June 2011                               55
jQuery, eCSStender & you




Step 2: Registration
   eCSStender.register(




        );




DevChatt - June 2011       56
jQuery, eCSStender & you




Step 2: Registration
   eCSStender.register(
     { property: '-easy-physics-fill',
        fingerprint: 'net.easy-designs.-easy-physics'
     },




        );




DevChatt - June 2011                                    57
jQuery, eCSStender & you




Step 2: Registration
   eCSStender.register(
     { property: '-easy-physics-fill',
        fingerprint: 'net.easy-designs.-easy-physics'
     },
     false,




        );




DevChatt - June 2011                                    58
jQuery, eCSStender & you




Step 2: Registration
   eCSStender.register(
     { property: '-easy-physics-fill',
        fingerprint: 'net.easy-designs.-easy-physics'
     },
     false,
     function( selector, properties ){
        var $el = $(selector);
        switch ( properties['-easy-physics-fill'] )
        {
          case 'helium':
            new EasyPhysics.Balloon( $el );
            break;
          case 'rubber':
            new EasyPhysics.RubberBall( $el );
            break;
          case 'lead':
            new EasyPhysics.BowlingBall( $el );
            break;
        }
     });




DevChatt - June 2011                                    59
jQuery, eCSStender & you




Pointless, but possible
   .bowling-alley img {
     -easy-physics-fill: lead;
   }
   .beach img {
     -easy-physics-fill: rubber;
   }
   .disney img {
     -easy-physics-fill: helium;
   }




DevChatt - June 2011               60
jQuery, eCSStender & you




Pointless, but possible
   .bowling-alley img {
     -easy-physics-fill: lead;
   }
   .beach img {
     -easy-physics-fill: rubber;
   }
   .disney img {
     -easy-physics-fill: helium;
   }




DevChatt - June 2011               60
I love you you know.

 I know.
Does the browser
support border-radius?

              Nope.




isSupported()
jQuery, eCSStender & you




isSupported()
   eCSStender.isSupported(
      'property',
      'visibility: hidden'
   );
   // true

   eCSStender.isSupported(
      'property',
      'foo: bar'
   );
   // false




DevChatt - June 2011         63
jQuery, eCSStender & you




isSupported()
   eCSStender.isSupported(
      'property',
      'visibility',
      'hidden'
   );
   // true

   eCSStender.isSupported(
      'property',
      'color',
      ['#000000','black','rgb(0,0,0)']
   );
   // true




DevChatt - June 2011                     64
jQuery, eCSStender & you




isSupported()
   var
   el = document.createElement('b'),
   html = document.createElement('p');
   html.appendChild(el);

   eCSStender.isSupported(
      'selector',
      'p b',
      html,
      el
   );
   // true

   eCSStender.isSupported(
      'selector',
      'p ?? b',
      html,
      el
   );
   // false




DevChatt - June 2011                     65
Can you make my
  CSS smarter?

         Of course.
jQuery, eCSStender & you




Inline style sucks...
   <div style="display: none;">
     <p>Some content</p>
   </div>




DevChatt - June 2011              67
jQuery, eCSStender & you




...don’t do it!
   <div style="display: none;">
     <p>Some content</p>
   </div>




DevChatt - June 2011              68
jQuery, eCSStender & you




makeUniqueClass()
   (function(){
     var
     e          = eCSStender,
     the_class = e.makeUniqueClass(),
     the_regex = /:checked/,
     classify = function() {
        var
        inputs = document.getElementsByTagName('input'),
        i      = inputs.length;
        while ( i-- ) {
          if ( inputs[i].checked ) {
            e.addClass( inputs[i], the_class );
          } else {
            e.removeClass( inputs[i], the_class );
          }
        }
     };

     // ...
   })();



                           excerpt from :checked CSS3 Selectors extension
            github.com/easy-designs/eCSStender.CSS3-selectors.js

DevChatt - June 2011                                                        69
jQuery, eCSStender & you




embedCSS()
   eCSStender.embedCSS(
      'p { color: red; }',
      'screen',
      false
   );
   // embeds the rule set in a
   // screen-specific stylesheet immediately




DevChatt - June 2011                           70
jQuery, eCSStender & you




applyWeightedStyle()
   eCSStender.applyWeightedStyle(
     el, { 'visibility': 'hidden' }, 10 );
   // el now has visibility: hidden set
   // with a specificity of 10

   eCSStender.applyWeightedStyle(
     el, { 'visibility': 'visible' }, 1 );
   // el is not set to visible because
   // the specificity is not high enough

   eCSStender.applyWeightedStyle(
     el, { 'visibility': 'visible' }, 10 );
   // el is now “visible” because the specificity
   // is equal to the prior specificity

   eCSStender.applyWeightedStyle(
     el, { 'visibility': 'hidden' }, 100 );
   // el is now “hidden” again because the
   // specificity is greater than the prior one




DevChatt - June 2011                                71
jQuery, eCSStender & you




As exible as possible
   function embed( selector, properties, medium )
   {
     var style_block = '', prop;
     for ( prop in properties )
     {
       if ( eCSStender.isInheritedProperty( properties, prop ) ) {
          continue;
       };
       style_block += prop + ':' + properties[prop] + ';';
     }
     if ( style_block != EMPTY )
     {
       eCSStender.embedCSS(
          selector + '{' + style_block + '}', medium
       );
     }
   }




                           excerpt from CSS3 Selectors extension
            github.com/easy-designs/eCSStender.CSS3-selectors.js

DevChatt - June 2011                                                 72
jQuery, eCSStender & you




As exible as possible
   function inline( selector, properties, medium, specificity ) {
     if ( medium != 'screen' ){ return; }
     try {
       var
       $els = $( selector ),
       i    = $els.length;
       while ( i-- ) {
         eCSStender.applyWeightedStyle( $els[i], properties, specificity );
       }
       $els = null;
     } catch(e) {
       // throw new Error( LIB_ERROR + selector );
     }
   }




                           excerpt from CSS3 Selectors extension
            github.com/easy-designs/eCSStender.CSS3-selectors.js

DevChatt - June 2011                                                          73
jQuery, eCSStender & you




As exible as possible
   eCSStender.register(
    // ...
    function( selector, properties, medium, specificity ) {
      var
      calc = 'p:nth-child(2n+1)',
      d = div.cloneNode(true),
      p = para.cloneNode(true),
      func = inline;
      d.appendChild( p );
      // embedding is the way to go
      if ( ( eCSStender.isSupported( 'selector', 'p:nth-child(odd)', d, p ) &&
             ! eCSStender.isSupported( 'selector', calc, d, p ) &&
             selector.match( /:nth-child(s*(?:even|odd)s*)/ ) != null ) ||
           eCSStender.isSupported( 'selector', calc, d, p ) ) {
        func = embed;
      }
      func( selector, properties, medium, specificity );
      return func;
    });




                           excerpt from :checked CSS3 Selectors extension
            github.com/easy-designs/eCSStender.CSS3-selectors.js

DevChatt - June 2011                                                             74
jQuery, eCSStender & you




addRules()
   var style = eCSStender.embedCSS(
      'p { color: red; }',
      'screen',
      false
   );

   // ...

   eCSStender.addRules(
      style,
      'p { color: blue; }'
   );




DevChatt - June 2011                  75
Can you look
something up for me?

             No problemo.
jQuery, eCSStender & you




lookup()
   var matches = eCSStender.lookup(
      {
         selector:    'h1',
         specificity: { min: 0, max: 2 }
      },
      '*'
   );
   // looks for rules where the
   // selector includes an h1 and the
   // specificity is between 0 and 2
   // e.g.
   // [ { medium:        'all'
   //       selector:    'h1',
   //       specificity: 1
   //       properties: { color: 'red' }
   //     }, ... ]




DevChatt - June 2011                       77
Help make me better!




              MIT Licensed

Fork: github.com/easy-designs/eCSStender.js
Discuss: groups.google.com/group/ecsstender
jQuery, eCSStender & you
                     by Aaron Gustafson
                     Slides available at
          http://slideshare.net/AaronGustafson
           This presentation is licensed under
                   Creative Commons
      Attribution-Noncommercial-Share Alike 3.0
                   More on eCSStender:
                   http://eCSStender.org
                       @eCSStender

                    flickr Photo Credits
             “Everyone loves books but I thought this was the
          dullest photo i had ever taken. I guess not.“ by boltron-
                            “Sharing” by bengrey
               “Three wise monkeys” by Anderson Mancini
                   “Chemcraft manual” by underwhelmer
                 “crawfordmarketcarrotman” by Rigmarole
                       “Röck!! on the right” by Adactio
                          “Internals” by alexsnaps
                     “Wood” by Joost J. Bakker IJmuiden
      “Tribute to Willy Puchner's ‘The Penguins Longing’” by Curnen
http:// ickr.com/photos/aarongustafson/galleries/72157625226185257/

Weitere ähnliche Inhalte

Ähnlich wie jQuery, eCSStender & You [DevChatt 2011]

내꺼내꺼
내꺼내꺼내꺼내꺼
내꺼내꺼misty915
 
SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019Razvan Stoenescu
 
Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)
Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)
Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)Igalia
 
Interactive Questions and Answers - London Information Retrieval Meetup
Interactive Questions and Answers - London Information Retrieval MeetupInteractive Questions and Answers - London Information Retrieval Meetup
Interactive Questions and Answers - London Information Retrieval MeetupSease
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using AxeRapidValue
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesLogeekNightUkraine
 
Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008maddinapudi
 
Better Front-end Development in Atlassian Plugins
Better Front-end Development in Atlassian PluginsBetter Front-end Development in Atlassian Plugins
Better Front-end Development in Atlassian PluginsWojciech Seliga
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013Alexandre Morgaut
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks TriviaCognizant
 
Programming in HTML5 With Java Script and CSS3
Programming in HTML5 With Java Script and CSS3Programming in HTML5 With Java Script and CSS3
Programming in HTML5 With Java Script and CSS3Testbells
 
JavaScript, VBScript, AJAX, CGI
JavaScript, VBScript, AJAX, CGIJavaScript, VBScript, AJAX, CGI
JavaScript, VBScript, AJAX, CGIAashish Jain
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Jeremy Likness
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereJohn Riviello
 
Javascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web AppsJavascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web Appsdnelson-cs
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Againjonknapp
 

Ähnlich wie jQuery, eCSStender & You [DevChatt 2011] (20)

내꺼내꺼
내꺼내꺼내꺼내꺼
내꺼내꺼
 
SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019
 
Brunch With Coffee
Brunch With CoffeeBrunch With Coffee
Brunch With Coffee
 
Jquery
JqueryJquery
Jquery
 
Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)
Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)
Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)
 
Interactive Questions and Answers - London Information Retrieval Meetup
Interactive Questions and Answers - London Information Retrieval MeetupInteractive Questions and Answers - London Information Retrieval Meetup
Interactive Questions and Answers - London Information Retrieval Meetup
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using Axe
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script Technologies
 
Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008
 
Better Front-end Development in Atlassian Plugins
Better Front-end Development in Atlassian PluginsBetter Front-end Development in Atlassian Plugins
Better Front-end Development in Atlassian Plugins
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks Trivia
 
Programming in HTML5 With Java Script and CSS3
Programming in HTML5 With Java Script and CSS3Programming in HTML5 With Java Script and CSS3
Programming in HTML5 With Java Script and CSS3
 
JavaScript, VBScript, AJAX, CGI
JavaScript, VBScript, AJAX, CGIJavaScript, VBScript, AJAX, CGI
JavaScript, VBScript, AJAX, CGI
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is Here
 
Javascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web AppsJavascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web Apps
 
DiscoJuice
DiscoJuiceDiscoJuice
DiscoJuice
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
 

Mehr von Aaron Gustafson

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Aaron Gustafson
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Aaron Gustafson
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Aaron Gustafson
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Aaron Gustafson
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Aaron Gustafson
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Aaron Gustafson
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Aaron Gustafson
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Aaron Gustafson
 
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Aaron Gustafson
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]Aaron Gustafson
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Aaron Gustafson
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Aaron Gustafson
 
Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Aaron Gustafson
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for EveryoneAaron Gustafson
 
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Aaron Gustafson
 
Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Aaron Gustafson
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Aaron Gustafson
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Aaron Gustafson
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Aaron Gustafson
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Aaron Gustafson
 

Mehr von Aaron Gustafson (20)

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]
 
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]
 
Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for Everyone
 
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]
 
Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]
 

Kürzlich hochgeladen

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

jQuery, eCSStender & You [DevChatt 2011]

  • 1. jQuery, eCSStender & you Aaron Gustafson Easy Designs, LLC slideshare.net/AaronGustafson
  • 2. ?
  • 3. ?
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. jQuery, eCSStender & you Download... eCSStender.org DevChatt - June 2011 12
  • 13. jQuery, eCSStender & you Download... eCSStender.org DevChatt - June 2011 13
  • 14. jQuery, eCSStender & you Download... github.com/easy-designs/eCSStender.js DevChatt - June 2011 14
  • 15. jQuery, eCSStender & you ...collect extensions... DevChatt - June 2011 15
  • 16. jQuery, eCSStender & you ...collect extensions... DevChatt - June 2011 16
  • 17. jQuery, eCSStender & you ...include... <script type="text/javascript" src="eCSStender.js"></script> <script type="text/javascript" src="eCSStender.CSS3-backgrounds-and-borders.js"></script> <script type="text/javascript" src="eCSStender.CSS3-transforms.js"></script> <script type="text/javascript" src="eCSStender.CSS3-color.js"></script> <script type="text/javascript" src="eCSStender.CSS3-transitions.js"></script> DevChatt - June 2011 17
  • 18. jQuery, eCSStender & you ...and write your CSS section, article, blockquote { border-radius: 10px; box-shadow: 0 0 15px 1px #000; color: rgb(255, 255, 255); transform-origin: 50% 50%; transition: all 0.5s linear; } section:hover, body:focus section, section:hover blockquote, body:focus blockquote { transform: rotate(-15deg); } section:hover article, body:focus article { transform: rotate(30deg); } DevChatt - June 2011 18
  • 19.
  • 20. jQuery, eCSStender & you Need selectors? <script type="text/javascript" src="eCSStender.js"></script> <script type="text/javascript" src="sizzle.js"></script> <script type="text/javascript"> // <![CDATA[ eCSStender.addMethod('findBySelector',Sizzle); // ]]> </script> <script type="text/javascript" src="eCSStender.CSS3-selectors.js"></script> DevChatt - June 2011 20
  • 21. jQuery, eCSStender & you Compound classes in IE6? p.test { color: green; } p.alt.test { color: red; } DevChatt - June 2011 21
  • 22. jQuery, eCSStender & you Adjacent siblings? p + p { color: green; } DevChatt - June 2011 22
  • 23. jQuery, eCSStender & you General siblings? p ~ p { color: green; } DevChatt - June 2011 23
  • 24. jQuery, eCSStender & you Advanced pseudo-classes? tr { background: white; } td:empty { background: green; } DevChatt - June 2011 24
  • 25.
  • 26. jQuery, eCSStender & you Consider border-radius #foo { border-radius: 3px; } DevChatt - June 2011 26
  • 27. jQuery, eCSStender & you Consider border-radius #foo { -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -khtml-border-radius: 3px; border-radius: 3px; } DevChatt - June 2011 27
  • 28. jQuery, eCSStender & you Consider border-radius #foo { border-radius: 10px 5px; } DevChatt - June 2011 28
  • 29. jQuery, eCSStender & you Consider border-radius #foo { -moz-border-radius: 10px 5px; -webkit-border-top-left-radius: 10px; -webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 10px; -webkit-border-bottom-left-radius: 10px; -o-border-radius: 10px 5px; -khtml-border-top-left-radius: 10px; -khtml-border-top-right-radius: 5px; -khtml-border-bottom-right-radius: 10px; -khtml-border-bottom-left-radius: 10px; border-radius: 10px 5px; } DevChatt - June 2011 29
  • 30. jQuery, eCSStender & you Ah, memories... #foo { padding: 10px; width: 200px; width: 180px; height: 200px; height: 180px; } /* or */ #foo { padding: 10px; width: 200px; height: 200px; } * html #foo { width: 180px; height: 180px; } DevChatt - June 2011 30
  • 31. jQuery, eCSStender & you Simpli ed CSS3? <script type="text/javascript" src="eCSStender.js"></script> <script type="text/javascript" src="eCSStender.CSS3-backgrounds-and-borders.js"></script> <script type="text/javascript" src="eCSStender.CSS3-transforms.js"></script> <script type="text/javascript" src="eCSStender.CSS3-color.js"></script> <script type="text/javascript" src="eCSStender.CSS3-transitions.js"></script> DevChatt - June 2011 31
  • 32. jQuery, eCSStender & you Yup! section, article, blockquote { border-radius: 10px; box-shadow: 0 0 15px 1px #000; color: rgb(255, 255, 255); transform-origin: 50% 50%; transition: all 0.5s linear; } section:hover, body:focus section, section:hover blockquote, body:focus blockquote { transform: rotate(-15deg); } section:hover article, body:focus article { transform: rotate(30deg); } DevChatt - June 2011 32
  • 33. jQuery, eCSStender & you Yup! section, article, blockquote { border-radius: 10px; box-shadow: 0 0 15px 1px #000; color: rgb(255, 255, 255); transform-origin: 50% 50%; transition: all 0.5s linear; } section:hover, body:focus section, section:hover blockquote, body:focus blockquote { transform: rotate(-15deg); } section:hover article, body:focus article { transform: rotate(30deg); } DevChatt - June 2011 32
  • 34.
  • 35. jQuery, eCSStender & you Valid extension of CSS -prefix- DevChatt - June 2011 34
  • 36. jQuery, eCSStender & you Browser vendors do it -moz- -webkit- -ms- -o- DevChatt - June 2011 35
  • 37.
  • 39. jQuery, eCSStender & you Pointless, but possible .bowling-alley img { -easy-physics-fill: lead; } .beach img { -easy-physics-fill: rubber; } .disney img { -easy-physics-fill: helium; } DevChatt - June 2011 38
  • 40. jQuery, eCSStender & you Pointless, but possible .bowling-alley img { -easy-physics-fill: lead; } .beach img { -easy-physics-fill: rubber; } .disney img { -easy-physics-fill: helium; } DevChatt - June 2011 38
  • 41.
  • 42. jQuery, eCSStender & you Step 1: Register extensions Register DevChatt - June 2011 40
  • 43. jQuery, eCSStender & you Step 2: Find stylesheets <html> CSS Inspect DevChatt - June 2011 41
  • 44. jQuery, eCSStender & you Step 3: Collect the rules Collect DevChatt - June 2011 42
  • 45. jQuery, eCSStender & you Step 4: parse & process Process DevChatt - June 2011 43
  • 46. jQuery, eCSStender & you Step 5: Trigger extensions DevChatt - June 2011 44
  • 47.
  • 48. jQuery, eCSStender & you Helping hands ๏ Dean Edward’s IE scripts ๏ Selectivizr ๏ css3-mediaqueries.js Browser Patchers DevChatt - June 2011 46
  • 49. jQuery, eCSStender & you Alternative syntax ๏ SASS (Syntactically Awesome Stylesheets) ๏ LESS (Leaner CSS) ๏ OO CSS (purely conceptual) Browser Shorthand Patchers Parsers DevChatt - June 2011 47
  • 50. jQuery, eCSStender & you Capability checking ๏ Modernizr Testing Scripts Browser Shorthand Patchers Parsers DevChatt - June 2011 48
  • 51. jQuery, eCSStender & you Something new ๏ More CSS Testing Scripts Browser Shorthand Patchers Parsers Custom CSS Parsers DevChatt - June 2011 49
  • 52. jQuery, eCSStender & you Ecosystem ๏ jQuery plug-ins ๏ CSS Sandpaper One-off CSS ๏ CVI scripts scripts& libraries Testing Scripts Browser Shorthand Patchers Parsers Custom CSS Parsers DevChatt - June 2011 50
  • 53. jQuery, eCSStender & you Unity! One-off CSS scripts& libraries Testing Scripts Browser Shorthand Patchers Parsers Custom CSS Parsers DevChatt - June 2011 51
  • 54. Let’s make something awesome! I thought you’d never ask.
  • 55. jQuery, eCSStender & you Pointless, but possible DevChatt - June 2011 53
  • 56. jQuery, eCSStender & you Step 1: Dependencies <script type="text/javascript" src="eCSStender.js"></script> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.EasyPhysics.js"></script> DevChatt - June 2011 54
  • 57. jQuery, eCSStender & you Step 1: Dependencies // jquery.EasyPhysics.js EasyPhysics.Balloon = function( el ) { new PhysicalObject( el, // element 0, // velocity -0.5, // kinetic energy -0.1 // gravitational effect ); }; EasyPhysics.RubberBall = function( el ) { new PhysicalObject( el, 0, -0.8, 0.5 ); }; EasyPhysics.BowlingBall = function( el ) { new PhysicalObject( el, 1, -0.4, 0.9 ); }; DevChatt - June 2011 55
  • 58. jQuery, eCSStender & you Step 2: Registration eCSStender.register( ); DevChatt - June 2011 56
  • 59. jQuery, eCSStender & you Step 2: Registration eCSStender.register( { property: '-easy-physics-fill', fingerprint: 'net.easy-designs.-easy-physics' }, ); DevChatt - June 2011 57
  • 60. jQuery, eCSStender & you Step 2: Registration eCSStender.register( { property: '-easy-physics-fill', fingerprint: 'net.easy-designs.-easy-physics' }, false, ); DevChatt - June 2011 58
  • 61. jQuery, eCSStender & you Step 2: Registration eCSStender.register( { property: '-easy-physics-fill', fingerprint: 'net.easy-designs.-easy-physics' }, false, function( selector, properties ){ var $el = $(selector); switch ( properties['-easy-physics-fill'] ) { case 'helium': new EasyPhysics.Balloon( $el ); break; case 'rubber': new EasyPhysics.RubberBall( $el ); break; case 'lead': new EasyPhysics.BowlingBall( $el ); break; } }); DevChatt - June 2011 59
  • 62. jQuery, eCSStender & you Pointless, but possible .bowling-alley img { -easy-physics-fill: lead; } .beach img { -easy-physics-fill: rubber; } .disney img { -easy-physics-fill: helium; } DevChatt - June 2011 60
  • 63. jQuery, eCSStender & you Pointless, but possible .bowling-alley img { -easy-physics-fill: lead; } .beach img { -easy-physics-fill: rubber; } .disney img { -easy-physics-fill: helium; } DevChatt - June 2011 60
  • 64. I love you you know. I know.
  • 65. Does the browser support border-radius? Nope. isSupported()
  • 66. jQuery, eCSStender & you isSupported() eCSStender.isSupported( 'property', 'visibility: hidden' ); // true eCSStender.isSupported( 'property', 'foo: bar' ); // false DevChatt - June 2011 63
  • 67. jQuery, eCSStender & you isSupported() eCSStender.isSupported( 'property', 'visibility', 'hidden' ); // true eCSStender.isSupported( 'property', 'color', ['#000000','black','rgb(0,0,0)'] ); // true DevChatt - June 2011 64
  • 68. jQuery, eCSStender & you isSupported() var el = document.createElement('b'), html = document.createElement('p'); html.appendChild(el); eCSStender.isSupported( 'selector', 'p b', html, el ); // true eCSStender.isSupported( 'selector', 'p ?? b', html, el ); // false DevChatt - June 2011 65
  • 69. Can you make my CSS smarter? Of course.
  • 70. jQuery, eCSStender & you Inline style sucks... <div style="display: none;"> <p>Some content</p> </div> DevChatt - June 2011 67
  • 71. jQuery, eCSStender & you ...don’t do it! <div style="display: none;"> <p>Some content</p> </div> DevChatt - June 2011 68
  • 72. jQuery, eCSStender & you makeUniqueClass() (function(){ var e = eCSStender, the_class = e.makeUniqueClass(), the_regex = /:checked/, classify = function() { var inputs = document.getElementsByTagName('input'), i = inputs.length; while ( i-- ) { if ( inputs[i].checked ) { e.addClass( inputs[i], the_class ); } else { e.removeClass( inputs[i], the_class ); } } }; // ... })(); excerpt from :checked CSS3 Selectors extension github.com/easy-designs/eCSStender.CSS3-selectors.js DevChatt - June 2011 69
  • 73. jQuery, eCSStender & you embedCSS() eCSStender.embedCSS( 'p { color: red; }', 'screen', false ); // embeds the rule set in a // screen-specific stylesheet immediately DevChatt - June 2011 70
  • 74. jQuery, eCSStender & you applyWeightedStyle() eCSStender.applyWeightedStyle( el, { 'visibility': 'hidden' }, 10 ); // el now has visibility: hidden set // with a specificity of 10 eCSStender.applyWeightedStyle( el, { 'visibility': 'visible' }, 1 ); // el is not set to visible because // the specificity is not high enough eCSStender.applyWeightedStyle( el, { 'visibility': 'visible' }, 10 ); // el is now “visible” because the specificity // is equal to the prior specificity eCSStender.applyWeightedStyle( el, { 'visibility': 'hidden' }, 100 ); // el is now “hidden” again because the // specificity is greater than the prior one DevChatt - June 2011 71
  • 75. jQuery, eCSStender & you As exible as possible function embed( selector, properties, medium ) { var style_block = '', prop; for ( prop in properties ) { if ( eCSStender.isInheritedProperty( properties, prop ) ) { continue; }; style_block += prop + ':' + properties[prop] + ';'; } if ( style_block != EMPTY ) { eCSStender.embedCSS( selector + '{' + style_block + '}', medium ); } } excerpt from CSS3 Selectors extension github.com/easy-designs/eCSStender.CSS3-selectors.js DevChatt - June 2011 72
  • 76. jQuery, eCSStender & you As exible as possible function inline( selector, properties, medium, specificity ) { if ( medium != 'screen' ){ return; } try { var $els = $( selector ), i = $els.length; while ( i-- ) { eCSStender.applyWeightedStyle( $els[i], properties, specificity ); } $els = null; } catch(e) { // throw new Error( LIB_ERROR + selector ); } } excerpt from CSS3 Selectors extension github.com/easy-designs/eCSStender.CSS3-selectors.js DevChatt - June 2011 73
  • 77. jQuery, eCSStender & you As exible as possible eCSStender.register( // ... function( selector, properties, medium, specificity ) { var calc = 'p:nth-child(2n+1)', d = div.cloneNode(true), p = para.cloneNode(true), func = inline; d.appendChild( p ); // embedding is the way to go if ( ( eCSStender.isSupported( 'selector', 'p:nth-child(odd)', d, p ) && ! eCSStender.isSupported( 'selector', calc, d, p ) && selector.match( /:nth-child(s*(?:even|odd)s*)/ ) != null ) || eCSStender.isSupported( 'selector', calc, d, p ) ) { func = embed; } func( selector, properties, medium, specificity ); return func; }); excerpt from :checked CSS3 Selectors extension github.com/easy-designs/eCSStender.CSS3-selectors.js DevChatt - June 2011 74
  • 78. jQuery, eCSStender & you addRules() var style = eCSStender.embedCSS( 'p { color: red; }', 'screen', false ); // ... eCSStender.addRules( style, 'p { color: blue; }' ); DevChatt - June 2011 75
  • 79. Can you look something up for me? No problemo.
  • 80. jQuery, eCSStender & you lookup() var matches = eCSStender.lookup( { selector: 'h1', specificity: { min: 0, max: 2 } }, '*' ); // looks for rules where the // selector includes an h1 and the // specificity is between 0 and 2 // e.g. // [ { medium: 'all' // selector: 'h1', // specificity: 1 // properties: { color: 'red' } // }, ... ] DevChatt - June 2011 77
  • 81.
  • 82. Help make me better! MIT Licensed Fork: github.com/easy-designs/eCSStender.js Discuss: groups.google.com/group/ecsstender
  • 83. jQuery, eCSStender & you by Aaron Gustafson Slides available at http://slideshare.net/AaronGustafson This presentation is licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 More on eCSStender: http://eCSStender.org @eCSStender flickr Photo Credits “Everyone loves books but I thought this was the dullest photo i had ever taken. I guess not.“ by boltron- “Sharing” by bengrey “Three wise monkeys” by Anderson Mancini “Chemcraft manual” by underwhelmer “crawfordmarketcarrotman” by Rigmarole “Röck!! on the right” by Adactio “Internals” by alexsnaps “Wood” by Joost J. Bakker IJmuiden “Tribute to Willy Puchner's ‘The Penguins Longing’” by Curnen http:// ickr.com/photos/aarongustafson/galleries/72157625226185257/