SlideShare a Scribd company logo
While we’re getting ready to start, please
              download the three exercises from:
              http://yuiblog.com/devday06/yui-css/



             YUI’s Foundational CSS
                     CSS Reset, CSS Fonts, CSS Grids




                                                                                               Nate Koechley
Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   Platform Engineering, Yahoo!
                                                                                                           1
YUI’s Foundational CSS
                     CSS Reset, CSS Fonts, CSS Grids




                                                                                               Nate Koechley
Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   Platform Engineering, Yahoo!
                                                                                                           2
About me…
                      natek@yahoo-inc.com

      • YUI team:
            – Engineer and Design Liaison
            – Technical Evangelist
      • Graded Browser Support…
            …and browser vendor coordination
      • http://yuiblog.com
      • http://nate.koechley.com/blog

Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   3
What we’ll cover…

      • Background and YUI CSS Goals
      • Hands-on with CSS Reset
      • Hands-on with CSS Fonts
      • Hands-on with CSS Grids
            – What It Does (x3)
            – Using It (x3)



Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   4
CSS is Accretive…

      • An element’s presentation accumulates
        substance from every rule that touches it
            – via direct declaration, cascade, inheritance


      • Put another way:
            – CSS rules build on one another




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   5
CSS’s Two Mechanisms

      • Cascade
            – many rules  single element
      • Inheritance
            – single rule  many elements



      (And don’t forget about cascading inheritance, of course.)


Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   6
CSS is Accretive… (cont’d)

      • The accretive aspects of CSS –
        cascade and inheritance – are the
        source of CSS’s power…




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   7
CSS is Accretive… (cont’d)

      … but also a source of vulnerability:

      A worrying equation:
            Slight disagreement on foundational rules
         + Slight disagreement on application of rules
      ----------------------------------------------------------------
         = Dramatic compounded difference!


Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   8
YUI CSS Goals

      1. Normalize and stabilize
            •      Sound foundation enables sane
                   development
      2. Maximize Availability and Accessibility
      3. Centralize wheel invention
      4. Centralize kludges
      5. A-Grade Browser Support
      6. Support Yahoo! Specifications
Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   9
The Three Tools

      1. CSS Reset
      2. CSS Fonts
      3. CSS Grids




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   10
YUI Reset – What it Does
                      http://developer.yahoo.com/yui/reset

      • Cross-browser normalization of the
        default rendering of HTML elements
            – Overcome browser.css
            – Level the playing field




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   11
Removes common “default”
                      presentation

      • Helps ensure all style is declared
        intentionally
            – You choose how you want to <em>phasize
              something
      • Allows us to choose elements based on
        their semantic meaning instead of their
        “default” presentation
            – You choose how you want to render <li>sts
      • A-Grade Browser Support
Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   12
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,
fieldset,input,p,blockquote,th,td
      {margin:0;padding:0;}
table
  {border-collapse:collapse;border-spacing:0;}
fieldset,img
  {border:0;}
address,caption,cite,code,dfn,em,strong,th,var
  {font-style:normal;font-weight:normal;}
ol,ul
  {list-style:none;}
caption,th
  {text-align:left;}
h1,h2,h3,h4,h5,h6
  {font-size:100%;}
q:before,q:after
  {content:'';}
Using YUI Reset http://
                      developer.yahoo.com/yui/reset

   • Step 1: Say what you mean.
   • (there is no Step 2)
                       strong {font-weight:bold;}
                       h1 {margin-bottom:1em;}


                       li {
                       background:transparent
                       url(dot.gif)
                       no-repeat left 6px;
                       padding:0 0 0 .55em;
                       }

Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   14
YUI Fonts – What it Does…
                      http://developer.yahoo.com/yui/fonts

      • Consistent font sizing and line-height
      • Appropriate cross-OS font-family
        degradation paths
            – e.g., arial, helvetica, sans-serif
      • Not fixed, so users can adjust the font
        size within their browser
            – Even when adjusted, better cross-browser
              consistency


Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   15
YUI Fonts – What it Does (cont’d)
                      http://developer.yahoo.com/yui/fonts

      • Works in both Quirks Mode and
        Standards Mode
            – A centralized “kludge” (was “hack”, but…)
            – We develop with HTML 4.01 Strict which
              puts us in Standards Mode
      • Normalizes “em” size (almost)
            – Allows font-size-responsive positioning
      • A-Grade Browser Support

Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   16
YUI Fonts – What it Does (cont’d)
                      http://developer.yahoo.com/yui/fonts

      • For free:
            – Font-family: Arial (except per OS)
            – Font-size = 13px (not pixels)
            – Line-height = 16px (not pixels)
      • Consistent em dimension.




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   17
Using YUI Fonts: Setting Size

      To get pixel size         Use this percentage                      http://developer.yahoo.com/yui/
      10px                      77%
      11px                      85%
      12px                      92%
      13px                      100%
      14px                      107%               h1 {font-size:136%;}
      15px                      114%               #node {font-size:77%;}
      16px                      122%
      17px                      129%
      18px                      136%
      19px                      144%
      20px                      152%

Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006                     18
Using YUI Fonts: Setting Font

 We use:
       – Arial (default)
       – Verdana
                                        h1 {font-family:georgia;}
       – Georgia
                                        #node {font-family:verdana;}
       – Tahoma                         .error {
       – Monospace                           font-size:77%;
                                             font-family:verdana;
                                             color:red;
                                        }


Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   19
Hands-on Exercise #1

  • Open hackday-exercise1.html
  • Match these specs:

                                                                          16 pixels

                                                                          Verdana 11 pixels and grey
                                                                          (#666)



                                                                          italic
                                                                          1em margin at the bottom of
                                                                          each paragraph and after
                                                                          source/timestamp


Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006                          20
YUI Grids – What it Does
                      http://developer.yahoo.com/yui/grids


      “The safe and easy way to create complex
        page and template layouts that are
        bulletproof and flexible.”


      • 130+ layouts from single efficient CSS file
            – (under 1.9kb)
      • Recursive, extensible system

Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   21
YUI Grids – What it Does (cont’d)
                      http://developer.yahoo.com/yui/grids

      • Scale with font-size adjustment
      • Source-order independent
      • Self-clearing footer
      • Fits all IAB Advertising Units
      • Forward-compatible (coming soon!)
      • A-Grade Browser Support


Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   22
How It Works…

      Two Components:
            1. Templates
            2. Subdivide with Grids and Units




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   23
How It Works… (cont’d)

      • Choose a template (yui-t1…yui-t7)




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   24
<body>
<div id="doc” class=“yui-t1”>
 <div id="hd"></div>
 <div id="bd">
    <div id=“yui-main”>
        <div class=“yui-b”></div>
    </div>
    <div class=“yui-b”></div>
 </div>
 <div id="ft"></div>
</div>
Hands-on Exercise #2

  • Open hackday-exercise2.html
  • Switch top-level template (yui-t1)
  • Experiment with source-order control




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   26
How It Works… (cont’d)

                                        • “Recursively subdivide”
                                        • Based on “grids”
                                          holding “units”


                                        • Custom “grids” for non-
                                          even unit distribution

Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   27
The Base Case:



.yui-g
    .yui-u first
    .yui-u
The Base Case:



.yui-g (tells children to take 50%)
    .yui-u first (obey parent)
    .yui-u (obey parent)
The Base Case:



<div class=“yui-g”>
  <div class=“yui-u first”></div>
  <div class=“yui-u”></div>
</div>
1. You Can Nest Grids.
2. Units and Grids can both be within Grids.

<div class=“yui-g”>
  <div class=“yui-u first”></div>
  <div class=“yui-g”>
    <div class=“yui-u first”></div>
    <div class=“yui-u”></div>
  </div>
</div>
What % does each take up?



<div class=“yui-g”>
 <div class=“yui-u first”></div>
 <div class=“yui-g”>
    <div class=“yui-u first”></div>
    <div class=“yui-u”></div>
 </div>
</div>
Special Grids (yui-g[a...f])



<div class=“yui-gb”>
 <div class=“yui-u first”>33%</div>
 <div class=“yui-u”>33%</div>
 <div class=“yui-u”>33%</div>
</div>
. . .
<div id=“bd”>
  <div class=“yui-b”></div>
  <div id=“yui-main”>
    <div class=“yui-b”>
       <div class=“yui-g”>
         <div class=“yui-u first”></div>
         <div class=“yui-u”></div>
       </div>
    </div>
  </div>
</div>
. . .
<div class=“yui-b”>
  <div class=“yui-g”>
    <div class=“yui-g first”>
         <div class=“yui-u first”></div>
         <div class=“yui-u”></div>
    </div>
    <div class=“yui-g”>
         <div class=“yui-u first”></div>
         <div class=“yui-u”></div>
    </div>
  </div>
</div>
.yui-g
  .yui-g first
     .yui-u first
     .yui-u
  .yui-g
     .yui-u first
     .yui-u
.yui-g (tells children to take 50%)
  .yui-g first (half of parent & children take half)
     .yui-u first (half of parent)
     .yui-u (half of parent)
  .yui-g (half of parent & children take half)
     .yui-u first (half of parent)
     .yui-u (half of parent)
Hands-on Exercise #3

                                      •      Open hackday-exercise3.html
                                      •      Experiment stacking grids
                                      •      Experiment nesting grids
                                      •      Experiment with custom grids




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   38
Thanks!

      • Available for questions all day and night
            – In Clasroom 1 and Classroom 6
            – Wandering around
      • Hack on, hackers




Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006   39

More Related Content

Viewers also liked

Regresiones, de Vicente Muñoz Ávarez
Regresiones, de Vicente Muñoz ÁvarezRegresiones, de Vicente Muñoz Ávarez
Regresiones, de Vicente Muñoz ÁvarezAna R. Otero
 
세바기(세상을 바꾸는 기술)_변화를 위한 무한도전
세바기(세상을 바꾸는 기술)_변화를 위한 무한도전세바기(세상을 바꾸는 기술)_변화를 위한 무한도전
세바기(세상을 바꾸는 기술)_변화를 위한 무한도전S.K. Cha of ACS in Korea
 
Designing a "nutrition facts" label for disclosing prepaid card fees
Designing a "nutrition facts" label for disclosing prepaid card feesDesigning a "nutrition facts" label for disclosing prepaid card fees
Designing a "nutrition facts" label for disclosing prepaid card feesDesiree Zamora Garcia
 
Industry
IndustryIndustry
Industrypriyase
 
S ilabus tik smp berkarakter kelas 7 sd 9
S ilabus tik smp berkarakter kelas 7 sd 9S ilabus tik smp berkarakter kelas 7 sd 9
S ilabus tik smp berkarakter kelas 7 sd 9suryo purnomo
 
mes와 fems을 활용한 생산공장 에너지효율화
 mes와 fems을 활용한 생산공장 에너지효율화 mes와 fems을 활용한 생산공장 에너지효율화
mes와 fems을 활용한 생산공장 에너지효율화S.K. Cha of ACS in Korea
 

Viewers also liked (11)

Essential YUI
Essential YUIEssential YUI
Essential YUI
 
Ciparay
CiparayCiparay
Ciparay
 
Media evaluation
Media evaluationMedia evaluation
Media evaluation
 
Regresiones, de Vicente Muñoz Ávarez
Regresiones, de Vicente Muñoz ÁvarezRegresiones, de Vicente Muñoz Ávarez
Regresiones, de Vicente Muñoz Ávarez
 
세바기(세상을 바꾸는 기술)_변화를 위한 무한도전
세바기(세상을 바꾸는 기술)_변화를 위한 무한도전세바기(세상을 바꾸는 기술)_변화를 위한 무한도전
세바기(세상을 바꾸는 기술)_변화를 위한 무한도전
 
Designing a "nutrition facts" label for disclosing prepaid card fees
Designing a "nutrition facts" label for disclosing prepaid card feesDesigning a "nutrition facts" label for disclosing prepaid card fees
Designing a "nutrition facts" label for disclosing prepaid card fees
 
Industry
IndustryIndustry
Industry
 
Analsisis pisa
Analsisis pisaAnalsisis pisa
Analsisis pisa
 
S ilabus tik smp berkarakter kelas 7 sd 9
S ilabus tik smp berkarakter kelas 7 sd 9S ilabus tik smp berkarakter kelas 7 sd 9
S ilabus tik smp berkarakter kelas 7 sd 9
 
e-Manufacturing; before and after
e-Manufacturing; before and aftere-Manufacturing; before and after
e-Manufacturing; before and after
 
mes와 fems을 활용한 생산공장 에너지효율화
 mes와 fems을 활용한 생산공장 에너지효율화 mes와 fems을 활용한 생산공장 에너지효율화
mes와 fems을 활용한 생산공장 에너지효율화
 

Similar to Yui css

Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!Christopher Batey
 
Jan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester MeetupJan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester MeetupChristopher Batey
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.GaziAhsan
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondAndy Stratton
 
SASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSencha
 

Similar to Yui css (7)

Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!
 
Jan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester MeetupJan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester Meetup
 
Drupal 7 ninja theming
Drupal 7 ninja themingDrupal 7 ninja theming
Drupal 7 ninja theming
 
Rwd slidedeck
Rwd slidedeckRwd slidedeck
Rwd slidedeck
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
SASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and Theming
 

Recently uploaded

Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 

Recently uploaded (20)

Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 

Yui css

  • 1. While we’re getting ready to start, please download the three exercises from: http://yuiblog.com/devday06/yui-css/ YUI’s Foundational CSS CSS Reset, CSS Fonts, CSS Grids Nate Koechley Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 Platform Engineering, Yahoo! 1
  • 2. YUI’s Foundational CSS CSS Reset, CSS Fonts, CSS Grids Nate Koechley Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 Platform Engineering, Yahoo! 2
  • 3. About me… natek@yahoo-inc.com • YUI team: – Engineer and Design Liaison – Technical Evangelist • Graded Browser Support… …and browser vendor coordination • http://yuiblog.com • http://nate.koechley.com/blog Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 3
  • 4. What we’ll cover… • Background and YUI CSS Goals • Hands-on with CSS Reset • Hands-on with CSS Fonts • Hands-on with CSS Grids – What It Does (x3) – Using It (x3) Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 4
  • 5. CSS is Accretive… • An element’s presentation accumulates substance from every rule that touches it – via direct declaration, cascade, inheritance • Put another way: – CSS rules build on one another Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 5
  • 6. CSS’s Two Mechanisms • Cascade – many rules  single element • Inheritance – single rule  many elements (And don’t forget about cascading inheritance, of course.) Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 6
  • 7. CSS is Accretive… (cont’d) • The accretive aspects of CSS – cascade and inheritance – are the source of CSS’s power… Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 7
  • 8. CSS is Accretive… (cont’d) … but also a source of vulnerability: A worrying equation: Slight disagreement on foundational rules + Slight disagreement on application of rules ---------------------------------------------------------------- = Dramatic compounded difference! Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 8
  • 9. YUI CSS Goals 1. Normalize and stabilize • Sound foundation enables sane development 2. Maximize Availability and Accessibility 3. Centralize wheel invention 4. Centralize kludges 5. A-Grade Browser Support 6. Support Yahoo! Specifications Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 9
  • 10. The Three Tools 1. CSS Reset 2. CSS Fonts 3. CSS Grids Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 10
  • 11. YUI Reset – What it Does http://developer.yahoo.com/yui/reset • Cross-browser normalization of the default rendering of HTML elements – Overcome browser.css – Level the playing field Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 11
  • 12. Removes common “default” presentation • Helps ensure all style is declared intentionally – You choose how you want to <em>phasize something • Allows us to choose elements based on their semantic meaning instead of their “default” presentation – You choose how you want to render <li>sts • A-Grade Browser Support Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 12
  • 13. body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form, fieldset,input,p,blockquote,th,td {margin:0;padding:0;} table {border-collapse:collapse;border-spacing:0;} fieldset,img {border:0;} address,caption,cite,code,dfn,em,strong,th,var {font-style:normal;font-weight:normal;} ol,ul {list-style:none;} caption,th {text-align:left;} h1,h2,h3,h4,h5,h6 {font-size:100%;} q:before,q:after {content:'';}
  • 14. Using YUI Reset http:// developer.yahoo.com/yui/reset • Step 1: Say what you mean. • (there is no Step 2) strong {font-weight:bold;} h1 {margin-bottom:1em;} li { background:transparent url(dot.gif) no-repeat left 6px; padding:0 0 0 .55em; } Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 14
  • 15. YUI Fonts – What it Does… http://developer.yahoo.com/yui/fonts • Consistent font sizing and line-height • Appropriate cross-OS font-family degradation paths – e.g., arial, helvetica, sans-serif • Not fixed, so users can adjust the font size within their browser – Even when adjusted, better cross-browser consistency Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 15
  • 16. YUI Fonts – What it Does (cont’d) http://developer.yahoo.com/yui/fonts • Works in both Quirks Mode and Standards Mode – A centralized “kludge” (was “hack”, but…) – We develop with HTML 4.01 Strict which puts us in Standards Mode • Normalizes “em” size (almost) – Allows font-size-responsive positioning • A-Grade Browser Support Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 16
  • 17. YUI Fonts – What it Does (cont’d) http://developer.yahoo.com/yui/fonts • For free: – Font-family: Arial (except per OS) – Font-size = 13px (not pixels) – Line-height = 16px (not pixels) • Consistent em dimension. Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 17
  • 18. Using YUI Fonts: Setting Size To get pixel size Use this percentage http://developer.yahoo.com/yui/ 10px 77% 11px 85% 12px 92% 13px 100% 14px 107% h1 {font-size:136%;} 15px 114% #node {font-size:77%;} 16px 122% 17px 129% 18px 136% 19px 144% 20px 152% Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 18
  • 19. Using YUI Fonts: Setting Font We use: – Arial (default) – Verdana h1 {font-family:georgia;} – Georgia #node {font-family:verdana;} – Tahoma .error { – Monospace font-size:77%; font-family:verdana; color:red; } Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 19
  • 20. Hands-on Exercise #1 • Open hackday-exercise1.html • Match these specs: 16 pixels Verdana 11 pixels and grey (#666) italic 1em margin at the bottom of each paragraph and after source/timestamp Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 20
  • 21. YUI Grids – What it Does http://developer.yahoo.com/yui/grids “The safe and easy way to create complex page and template layouts that are bulletproof and flexible.” • 130+ layouts from single efficient CSS file – (under 1.9kb) • Recursive, extensible system Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 21
  • 22. YUI Grids – What it Does (cont’d) http://developer.yahoo.com/yui/grids • Scale with font-size adjustment • Source-order independent • Self-clearing footer • Fits all IAB Advertising Units • Forward-compatible (coming soon!) • A-Grade Browser Support Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 22
  • 23. How It Works… Two Components: 1. Templates 2. Subdivide with Grids and Units Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 23
  • 24. How It Works… (cont’d) • Choose a template (yui-t1…yui-t7) Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 24
  • 25. <body> <div id="doc” class=“yui-t1”> <div id="hd"></div> <div id="bd"> <div id=“yui-main”> <div class=“yui-b”></div> </div> <div class=“yui-b”></div> </div> <div id="ft"></div> </div>
  • 26. Hands-on Exercise #2 • Open hackday-exercise2.html • Switch top-level template (yui-t1) • Experiment with source-order control Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 26
  • 27. How It Works… (cont’d) • “Recursively subdivide” • Based on “grids” holding “units” • Custom “grids” for non- even unit distribution Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 27
  • 28. The Base Case: .yui-g .yui-u first .yui-u
  • 29. The Base Case: .yui-g (tells children to take 50%) .yui-u first (obey parent) .yui-u (obey parent)
  • 30. The Base Case: <div class=“yui-g”> <div class=“yui-u first”></div> <div class=“yui-u”></div> </div>
  • 31. 1. You Can Nest Grids. 2. Units and Grids can both be within Grids. <div class=“yui-g”> <div class=“yui-u first”></div> <div class=“yui-g”> <div class=“yui-u first”></div> <div class=“yui-u”></div> </div> </div>
  • 32. What % does each take up? <div class=“yui-g”> <div class=“yui-u first”></div> <div class=“yui-g”> <div class=“yui-u first”></div> <div class=“yui-u”></div> </div> </div>
  • 33. Special Grids (yui-g[a...f]) <div class=“yui-gb”> <div class=“yui-u first”>33%</div> <div class=“yui-u”>33%</div> <div class=“yui-u”>33%</div> </div>
  • 34. . . . <div id=“bd”> <div class=“yui-b”></div> <div id=“yui-main”> <div class=“yui-b”> <div class=“yui-g”> <div class=“yui-u first”></div> <div class=“yui-u”></div> </div> </div> </div> </div>
  • 35. . . . <div class=“yui-b”> <div class=“yui-g”> <div class=“yui-g first”> <div class=“yui-u first”></div> <div class=“yui-u”></div> </div> <div class=“yui-g”> <div class=“yui-u first”></div> <div class=“yui-u”></div> </div> </div> </div>
  • 36. .yui-g .yui-g first .yui-u first .yui-u .yui-g .yui-u first .yui-u
  • 37. .yui-g (tells children to take 50%) .yui-g first (half of parent & children take half) .yui-u first (half of parent) .yui-u (half of parent) .yui-g (half of parent & children take half) .yui-u first (half of parent) .yui-u (half of parent)
  • 38. Hands-on Exercise #3 • Open hackday-exercise3.html • Experiment stacking grids • Experiment nesting grids • Experiment with custom grids Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 38
  • 39. Thanks! • Available for questions all day and night – In Clasroom 1 and Classroom 6 – Wandering around • Hack on, hackers Nate Koechley – natek@yahoo-inc.com – Yahoo! Hack Day, September 29/30th, 2006 39