SlideShare a Scribd company logo
1 of 83
Download to read offline
CSS
Aaron Gustafson
Easy Designs, LLC
slideshare.net/AaronGustafson
?
?
CSS & eCSStender




Download...




                         eCSStender.org
CSS Summit - July 2011                    12
CSS & eCSStender




Download...




                         eCSStender.org
CSS Summit - July 2011                    13
CSS & eCSStender




Download...




                         github.com/easy-designs/eCSStender.js
CSS Summit - July 2011                                           14
CSS & eCSStender




...collect extensions...




CSS Summit - July 2011     15
CSS & eCSStender




...collect extensions...




CSS Summit - July 2011     16
CSS & eCSStender




...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>




CSS Summit - July 2011                                                                                   17
CSS & eCSStender




...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);
   }




CSS Summit - July 2011                18
CSS & eCSStender




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>




CSS Summit - July 2011                                                           20
CSS & eCSStender




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




CSS Summit - July 2011     21
CSS & eCSStender




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




CSS Summit - July 2011   22
CSS & eCSStender




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




CSS Summit - July 2011   23
CSS & eCSStender




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




CSS Summit - July 2011     24
CSS & eCSStender




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




CSS Summit - July 2011     26
CSS & eCSStender




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




CSS Summit - July 2011             27
CSS & eCSStender




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




CSS Summit - July 2011          28
CSS & eCSStender




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;
   }




CSS Summit - July 2011                           29
CSS & eCSStender




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;
   }




CSS Summit - July 2011   30
CSS & eCSStender




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>




CSS Summit - July 2011                                                                                   31
CSS & eCSStender




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);
  }



                                     http://ecsstender.org/demos/spoon/




CSS Summit - July 2011                                                    32
CSS & eCSStender




Valid extension of CSS



                         -prefix-


CSS Summit - July 2011              34
CSS & eCSStender




Browser vendors do it




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




CSS Summit - July 2011                           35
THE FUTURE OF CSS
CSS & eCSStender




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




                                   http://ecsstender.org/demos/physics/




CSS Summit - July 2011                                                    38
CSS & eCSStender




Step 1: Register extensions



                         Register




CSS Summit - July 2011              40
CSS & eCSStender




Step 2: Find stylesheets


                         <html>

                           CSS    Inspect




CSS Summit - July 2011                      41
CSS & eCSStender




Step 3: Collect the rules



                         Collect




CSS Summit - July 2011             42
CSS & eCSStender




Step 4: parse & process



                         Process




CSS Summit - July 2011             43
CSS & eCSStender




Step 5: Trigger extensions




CSS Summit - July 2011       44
CSS & eCSStender




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




    CSS Summit - July 2011                46
CSS & eCSStender




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

                                         Browser    Shorthand
                                         Patchers    Parsers




    CSS Summit - July 2011                                      47
CSS & eCSStender




    Capability checking
๏   Modernizr
                                        Testing
                                        Scripts



                             Browser         Shorthand
                             Patchers         Parsers




    CSS Summit - July 2011                               48
CSS & eCSStender




    Something new
๏   More CSS
                                        Testing
                                        Scripts



                             Browser         Shorthand
                             Patchers         Parsers

                                        Custom
                                         CSS
                                        Parsers




    CSS Summit - July 2011                               49
CSS & eCSStender




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

                                            Testing
                                            Scripts


                                 Browser          Shorthand
                                 Patchers          Parsers

                                            Custom
                                             CSS
                                            Parsers




    CSS Summit - July 2011                                    50
CSS & eCSStender




Unity!
                           One-off CSS
                         scripts& libraries

                                        Testing
                                        Scripts


                             Browser          Shorthand
                             Patchers          Parsers

                                        Custom
                                         CSS
                                        Parsers




CSS Summit - July 2011                                    51
Let’s make
something awesome!

       I thought you’d never ask.
CSS & eCSStender




Pointless, but possible




CSS Summit - July 2011    53
CSS & eCSStender




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>




CSS Summit - July 2011                                                    54
CSS & eCSStender




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   );
   };




CSS Summit - July 2011                             55
CSS & eCSStender




Step 2: Registration
   eCSStender.register(




        );




CSS Summit - July 2011    56
CSS & eCSStender




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




        );




CSS Summit - July 2011                                  57
CSS & eCSStender




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




        );




CSS Summit - July 2011                                  58
CSS & eCSStender




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;
        }
     });




CSS Summit - July 2011                                  59
CSS & eCSStender




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




                                   http://ecsstender.org/demos/physics/




CSS Summit - July 2011                                                    60
I love you you know.

 I know.
Does the browser
support border-radius?

              Nope.




isSupported()
CSS & eCSStender




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

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




CSS Summit - July 2011       63
CSS & eCSStender




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

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




CSS Summit - July 2011                   64
CSS & eCSStender




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




CSS Summit - July 2011                   65
Can you make my
  CSS smarter?

         Of course.
CSS & eCSStender




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




CSS Summit - July 2011            67
CSS & eCSStender




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




CSS Summit - July 2011            68
CSS & eCSStender




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



CSS Summit - July 2011                                                          69
CSS & eCSStender




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




CSS Summit - July 2011                         70
CSS & eCSStender




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




CSS Summit - July 2011                              71
CSS & eCSStender




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



CSS Summit - July 2011                                                          72
CSS & eCSStender




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



CSS Summit - July 2011                                                          73
CSS & eCSStender




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



CSS Summit - July 2011                                                           74
CSS & eCSStender




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

   // ...

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




CSS Summit - July 2011                75
Can you look
something up for me?

             No problemo.
CSS & eCSStender




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' }
   //     }, ... ]




CSS Summit - July 2011                     77
CSS & eCSStender




elementMatchesSelector()
   if ( eCSStender.elementMatchesSelector( el, 'div:last-child' ) )
   {
     // do something with the div
   }
   else
   {
     // element wasn’t what we were looking for
   }




CSS Summit - July 2011                                                78
CSS & eCSStender




matchMedia()
   if ( eCSStender.matchMedia( 'screen and (max-width=1024)' ) )
   {
     // screen might be a tablet
   }




CSS Summit - July 2011                                             79
CSS & eCSStender




getCSSValue()
   if ( eCSStender.getCSSValue( element, 'display' ) == 'none' )
   {
     // element is currently hidden
   }




CSS Summit - July 2011                                             80
Help make me better!




              MIT Licensed

Fork: github.com/easy-designs/eCSStender.js
Discuss: groups.google.com/group/ecsstender
CSS & eCSStender
                     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/

More Related Content

What's hot

Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Pascal Rettig
 
Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Graham Armfield
 
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...Guillaume Kossi
 
WHAT IS HTML5? (at CSS Nite Osaka)
WHAT IS HTML5? (at CSS Nite Osaka)WHAT IS HTML5? (at CSS Nite Osaka)
WHAT IS HTML5? (at CSS Nite Osaka)Shumpei Shiraishi
 

What's hot (8)

Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018
 
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
 
WHAT IS HTML5? (at CSS Nite Osaka)
WHAT IS HTML5? (at CSS Nite Osaka)WHAT IS HTML5? (at CSS Nite Osaka)
WHAT IS HTML5? (at CSS Nite Osaka)
 
Html5
Html5Html5
Html5
 
Html5
Html5Html5
Html5
 
Next generation Graphics: SVG
Next generation Graphics: SVGNext generation Graphics: SVG
Next generation Graphics: SVG
 

Similar to CSS & eCSStender [CSS Summit 2011]

jQuery, eCSStender & You [DevChatt 2011]
jQuery, eCSStender & You [DevChatt 2011]jQuery, eCSStender & You [DevChatt 2011]
jQuery, eCSStender & You [DevChatt 2011]Aaron Gustafson
 
Introduction to sass
Introduction to sassIntroduction to sass
Introduction to sassAnoop Raveendran
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
HTML5とIE10とWindows 8 in OSC2012会津
HTML5とIE10とWindows 8 in OSC2012会津HTML5とIE10とWindows 8 in OSC2012会津
HTML5とIE10とWindows 8 in OSC2012会津Microsoft
 
Get Started With Tailwind React and Create Beautiful Apps.pdf
Get Started With Tailwind React and Create Beautiful Apps.pdfGet Started With Tailwind React and Create Beautiful Apps.pdf
Get Started With Tailwind React and Create Beautiful Apps.pdfRonDosh
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}Eric Carlisle
 
6 css week12 2020 2021 for g10
6 css week12 2020 2021 for g106 css week12 2020 2021 for g10
6 css week12 2020 2021 for g10Osama Ghandour Geris
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS FrameworkGareth Saunders
 
Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designersPai-Cheng Tao
 
Progressive EEnhancement [EECI 2011]
Progressive EEnhancement [EECI 2011]Progressive EEnhancement [EECI 2011]
Progressive EEnhancement [EECI 2011]Aaron Gustafson
 
Make your CSS beautiful again
Make your CSS beautiful againMake your CSS beautiful again
Make your CSS beautiful againspannerspace Hales
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS MethodologyZohar Arad
 
SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019Razvan Stoenescu
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourOsama Ghandour Geris
 
20111129 modernizr
20111129 modernizr20111129 modernizr
20111129 modernizrbrooky-yen
 
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!Stefan Bauer
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer NotesVskills
 

Similar to CSS & eCSStender [CSS Summit 2011] (20)

jQuery, eCSStender & You [DevChatt 2011]
jQuery, eCSStender & You [DevChatt 2011]jQuery, eCSStender & You [DevChatt 2011]
jQuery, eCSStender & You [DevChatt 2011]
 
Preprocessor CSS: SASS
Preprocessor CSS: SASSPreprocessor CSS: SASS
Preprocessor CSS: SASS
 
slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
Php ppt
Php pptPhp ppt
Php ppt
 
Introduction to sass
Introduction to sassIntroduction to sass
Introduction to sass
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
HTML5とIE10とWindows 8 in OSC2012会津
HTML5とIE10とWindows 8 in OSC2012会津HTML5とIE10とWindows 8 in OSC2012会津
HTML5とIE10とWindows 8 in OSC2012会津
 
Get Started With Tailwind React and Create Beautiful Apps.pdf
Get Started With Tailwind React and Create Beautiful Apps.pdfGet Started With Tailwind React and Create Beautiful Apps.pdf
Get Started With Tailwind React and Create Beautiful Apps.pdf
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 
6 css week12 2020 2021 for g10
6 css week12 2020 2021 for g106 css week12 2020 2021 for g10
6 css week12 2020 2021 for g10
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
 
Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designers
 
Progressive EEnhancement [EECI 2011]
Progressive EEnhancement [EECI 2011]Progressive EEnhancement [EECI 2011]
Progressive EEnhancement [EECI 2011]
 
Make your CSS beautiful again
Make your CSS beautiful againMake your CSS beautiful again
Make your CSS beautiful again
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandour
 
20111129 modernizr
20111129 modernizr20111129 modernizr
20111129 modernizr
 
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
 

More from 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
 

More from 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]
 

Recently uploaded

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 

CSS & eCSStender [CSS Summit 2011]

  • 1. CSS Aaron Gustafson Easy Designs, LLC slideshare.net/AaronGustafson
  • 2. ?
  • 3. ?
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. CSS & eCSStender Download... eCSStender.org CSS Summit - July 2011 12
  • 13. CSS & eCSStender Download... eCSStender.org CSS Summit - July 2011 13
  • 14. CSS & eCSStender Download... github.com/easy-designs/eCSStender.js CSS Summit - July 2011 14
  • 15. CSS & eCSStender ...collect extensions... CSS Summit - July 2011 15
  • 16. CSS & eCSStender ...collect extensions... CSS Summit - July 2011 16
  • 17. CSS & eCSStender ...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> CSS Summit - July 2011 17
  • 18. CSS & eCSStender ...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); } CSS Summit - July 2011 18
  • 19.
  • 20. CSS & eCSStender 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> CSS Summit - July 2011 20
  • 21. CSS & eCSStender Compound classes in IE6? p.test { color: green; } p.alt.test { color: red; } CSS Summit - July 2011 21
  • 22. CSS & eCSStender Adjacent siblings? p + p { color: green; } CSS Summit - July 2011 22
  • 23. CSS & eCSStender General siblings? p ~ p { color: green; } CSS Summit - July 2011 23
  • 24. CSS & eCSStender Advanced pseudo-classes? tr { background: white; } td:empty { background: green; } CSS Summit - July 2011 24
  • 25.
  • 26. CSS & eCSStender Consider border-radius #foo { border-radius: 3px; } CSS Summit - July 2011 26
  • 27. CSS & eCSStender Consider border-radius #foo { -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -khtml-border-radius: 3px; border-radius: 3px; } CSS Summit - July 2011 27
  • 28. CSS & eCSStender Consider border-radius #foo { border-radius: 10px 5px; } CSS Summit - July 2011 28
  • 29. CSS & eCSStender 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; } CSS Summit - July 2011 29
  • 30. CSS & eCSStender 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; } CSS Summit - July 2011 30
  • 31. CSS & eCSStender 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> CSS Summit - July 2011 31
  • 32. CSS & eCSStender 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); } http://ecsstender.org/demos/spoon/ CSS Summit - July 2011 32
  • 33.
  • 34. CSS & eCSStender Valid extension of CSS -prefix- CSS Summit - July 2011 34
  • 35. CSS & eCSStender Browser vendors do it -moz- -webkit- -ms- -o- CSS Summit - July 2011 35
  • 36.
  • 38. CSS & eCSStender Pointless, but possible .bowling-alley img { -easy-physics-fill: lead; } .beach img { -easy-physics-fill: rubber; } .disney img { -easy-physics-fill: helium; } http://ecsstender.org/demos/physics/ CSS Summit - July 2011 38
  • 39.
  • 40. CSS & eCSStender Step 1: Register extensions Register CSS Summit - July 2011 40
  • 41. CSS & eCSStender Step 2: Find stylesheets <html> CSS Inspect CSS Summit - July 2011 41
  • 42. CSS & eCSStender Step 3: Collect the rules Collect CSS Summit - July 2011 42
  • 43. CSS & eCSStender Step 4: parse & process Process CSS Summit - July 2011 43
  • 44. CSS & eCSStender Step 5: Trigger extensions CSS Summit - July 2011 44
  • 45.
  • 46. CSS & eCSStender Helping hands ๏ Dean Edward’s IE scripts ๏ Selectivizr ๏ css3-mediaqueries.js ๏ Respond.js Browser Patchers CSS Summit - July 2011 46
  • 47. CSS & eCSStender Alternative syntax ๏ SASS (Syntactically Awesome Stylesheets) ๏ LESS (Leaner CSS) ๏ OO CSS (purely conceptual) Browser Shorthand Patchers Parsers CSS Summit - July 2011 47
  • 48. CSS & eCSStender Capability checking ๏ Modernizr Testing Scripts Browser Shorthand Patchers Parsers CSS Summit - July 2011 48
  • 49. CSS & eCSStender Something new ๏ More CSS Testing Scripts Browser Shorthand Patchers Parsers Custom CSS Parsers CSS Summit - July 2011 49
  • 50. CSS & eCSStender Ecosystem ๏ jQuery plug-ins ๏ CSS Sandpaper One-off CSS ๏ CVI scripts scripts& libraries Testing Scripts Browser Shorthand Patchers Parsers Custom CSS Parsers CSS Summit - July 2011 50
  • 51. CSS & eCSStender Unity! One-off CSS scripts& libraries Testing Scripts Browser Shorthand Patchers Parsers Custom CSS Parsers CSS Summit - July 2011 51
  • 52. Let’s make something awesome! I thought you’d never ask.
  • 53. CSS & eCSStender Pointless, but possible CSS Summit - July 2011 53
  • 54. CSS & eCSStender 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> CSS Summit - July 2011 54
  • 55. CSS & eCSStender 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 ); }; CSS Summit - July 2011 55
  • 56. CSS & eCSStender Step 2: Registration eCSStender.register( ); CSS Summit - July 2011 56
  • 57. CSS & eCSStender Step 2: Registration eCSStender.register( { property: '-easy-physics-fill', fingerprint: 'net.easy-designs.-easy-physics' }, ); CSS Summit - July 2011 57
  • 58. CSS & eCSStender Step 2: Registration eCSStender.register( { property: '-easy-physics-fill', fingerprint: 'net.easy-designs.-easy-physics' }, false, ); CSS Summit - July 2011 58
  • 59. CSS & eCSStender 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; } }); CSS Summit - July 2011 59
  • 60. CSS & eCSStender Pointless, but possible .bowling-alley img { -easy-physics-fill: lead; } .beach img { -easy-physics-fill: rubber; } .disney img { -easy-physics-fill: helium; } http://ecsstender.org/demos/physics/ CSS Summit - July 2011 60
  • 61. I love you you know. I know.
  • 62. Does the browser support border-radius? Nope. isSupported()
  • 63. CSS & eCSStender isSupported() eCSStender.isSupported( 'property', 'visibility: hidden' ); // true eCSStender.isSupported( 'property', 'foo: bar' ); // false CSS Summit - July 2011 63
  • 64. CSS & eCSStender isSupported() eCSStender.isSupported( 'property', 'visibility', 'hidden' ); // true eCSStender.isSupported( 'property', 'color', ['#000000','black','rgb(0,0,0)'] ); // true CSS Summit - July 2011 64
  • 65. CSS & eCSStender 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 CSS Summit - July 2011 65
  • 66. Can you make my CSS smarter? Of course.
  • 67. CSS & eCSStender Inline style sucks... <div style="display: none;"> <p>Some content</p> </div> CSS Summit - July 2011 67
  • 68. CSS & eCSStender ...don’t do it! <div style="display: none;"> <p>Some content</p> </div> CSS Summit - July 2011 68
  • 69. CSS & eCSStender 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 CSS Summit - July 2011 69
  • 70. CSS & eCSStender embedCSS() eCSStender.embedCSS( 'p { color: red; }', 'screen', false ); // embeds the rule set in a // screen-specific stylesheet immediately CSS Summit - July 2011 70
  • 71. CSS & eCSStender 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 CSS Summit - July 2011 71
  • 72. CSS & eCSStender 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 CSS Summit - July 2011 72
  • 73. CSS & eCSStender 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 CSS Summit - July 2011 73
  • 74. CSS & eCSStender 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 CSS Summit - July 2011 74
  • 75. CSS & eCSStender addRules() var style = eCSStender.embedCSS( 'p { color: red; }', 'screen', false ); // ... eCSStender.addRules( style, 'p { color: blue; }' ); CSS Summit - July 2011 75
  • 76. Can you look something up for me? No problemo.
  • 77. CSS & eCSStender 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' } // }, ... ] CSS Summit - July 2011 77
  • 78. CSS & eCSStender elementMatchesSelector() if ( eCSStender.elementMatchesSelector( el, 'div:last-child' ) ) { // do something with the div } else { // element wasn’t what we were looking for } CSS Summit - July 2011 78
  • 79. CSS & eCSStender matchMedia() if ( eCSStender.matchMedia( 'screen and (max-width=1024)' ) ) { // screen might be a tablet } CSS Summit - July 2011 79
  • 80. CSS & eCSStender getCSSValue() if ( eCSStender.getCSSValue( element, 'display' ) == 'none' ) { // element is currently hidden } CSS Summit - July 2011 80
  • 81.
  • 82. Help make me better! MIT Licensed Fork: github.com/easy-designs/eCSStender.js Discuss: groups.google.com/group/ecsstender
  • 83. CSS & eCSStender 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/