SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
CSS Master Class
Chris Gonzalez
Expert Interaction Designer
chris.gonzalez@turner.com
Monday, July 29, 13
Who am I?
I am an Interaction Designer.
In my job, I am responsible for concepting,
visual (and graphic) design, high-level
system design, rapid prototyping, and front-
end development
Monday, July 29, 13
Mobile Apps Site Redesign
Monday, July 29, 13
IT Strategy Blog
Monday, July 29, 13
Tweet of the Union
Monday, July 29, 13
MyBodyTheMachine (personal)
Monday, July 29, 13
What we won’t cover
• CSS Animations, Media Queries, and
Responsive Design
• CSS Preprocessors like SASS, SCSS, LESS
• Helping you solve [some CSS problem] with
[some code library]
• 100% all knowledge you’ll ever need for CSS
• Graphic/Visual Design
Monday, July 29, 13
What we will cover
• The benefits of clean, semantic markup
• Simplicity!
• Writing clean, semantic CSS
• Basics of selectors, cascading styles, and
specificity
• Designing intentionally for a dynamic world
Monday, July 29, 13
Part 1
CSS as a descriptive practice
Monday, July 29, 13
What words can we use to describe the structure of
this button?
Example 1 : A (not-so) simple button
Monday, July 29, 13
What words can we use to describe the visual style of
this button?
Example 1 : A (not-so) simple button
Monday, July 29, 13
This is how ext.js describes this button in code! Gross!
Example 1 : A (not-so) simple button
Monday, July 29, 13
And this is only a fraction of the CSS used! Bad! No!
Example 1 : A (not-so) simple button
Monday, July 29, 13
What words can we use to describe the structure of
this dialog?
Example 2 : A verbose dialog
Monday, July 29, 13
What words can we use to describe the visual style of
this dialog?
Example 2 : A verbose dialog
Monday, July 29, 13
Well this is how jQuery UI describes it in code.. WHY!
Example 2 : A verbose dialog
Monday, July 29, 13
And this is just a portion of the CSS required! AHH!
Example 2 : A verbose dialog
Monday, July 29, 13
Rule #1
KEEP IT SIMPLE and SEMANTIC
CSS is only as good as your markup.
Monday, July 29, 13
This is simple, readable, and all we really need.
Example 3 : A simple button
<button class=”home”>Home</button>
http://codepen.io/chrisgonzalez/pen/Jedvw
Monday, July 29, 13
This is also simple and readable, and all we need.
Example 3 : A simple button
button.home {
border-radius: 8px;
border: 0px;
padding: 15px;
font-weight: bold;
font-size: 1.2em;
background: #369;
color: #ffffff;
}
http://codepen.io/chrisgonzalez/pen/Jedvw
Monday, July 29, 13
HTML : Use semantic tags!
<header>
<nav>
<section>
<aside>
<article>
<footer>
Using semantic tags will make
your code machine readable,
human readable, and easier to
style!
HTML5 is not new! These tags
are supported back to IE6
Monday, July 29, 13
HTML : Less is more!
Instead of modifying these 2043 style rules for a new
button, try...
xMonday, July 29, 13
HTML : Less is more!
Modifying 1 or 2 rules. Better? :)
<button class=”home”>Home</button>
Monday, July 29, 13
Rule #2
CSS MASTERY IS
KNOWING THE BASICS,
AND USING THEM WELL.
All the fancy *CSS3* stuff like animations and
transitions are built to use the basics in new and
exciting ways. No basics? No fancy!
Monday, July 29, 13
CSS is used to visually describe your document.
You can describe things generally, or specifically.
Monday, July 29, 13
CSS Basics: Cascading!
If we say it like a human, we can describe:
ALL buttons:
button { }
The buttons in the navigation:
nav button { }
That specific “save” button in that one dialog:
div.ThatOneDialog button.save { }
Monday, July 29, 13
CSS Basics: Cascading!
All three of those style definitions will be applied
in order of specificity (1st) and line number (2nd):
button { } - most general, applies to ALL buttons
nav button { } - kinda specific, inherits styles from above
.ThatOneDialog button.save { } - very specific, inherits
first button style
Monday, July 29, 13
CSS Selectors: Explain it to me in Star Wars
http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html
Monday, July 29, 13
Rule #3
START GENERAL AND WORK
TOWARDS SPECIFIC
Starting with general style rules will help you get
moving quickly and more easily identify elements that
do need specific styles.
Monday, July 29, 13
CSS Selectors: Specificity
Be specific with purpose
#button.button.ui-dialog-button.thisisabutton { } - Bad!
#dialog footer button.close { } - OK! This is better :)
But do we need all that specificity? Probably not!
button.close { } - Very nice, also: reusable
Monday, July 29, 13
CSS Selectors: Be intentional!
Be intentional with selectors.
element {}
.class {}
#id
element[attribute=”value”]
element:first-child
element:nth-child(2n+1)
element:before
element:after
Monday, July 29, 13
Example 4: A dialog with two states
<div class="dialog">
<header>
<h3 class="title">This is a dialog</h3>
<button class="close">(x)</button>
</header>
This dialog is pretty awesome. I made it myself and it
only took like 10 minutes. Additionally, it's really easy to
edit and restyle!
</div>
http://codepen.io/chrisgonzalez/pen/spCGy
Part 1: Markup
Monday, July 29, 13
Example 4: A dialog with two states
.dialog{
position:relative;
width:50%;
margin:10% auto;
background:#ffffff;
padding:20px;
border-radius:10px;
box-shadow:0px 0px ... ;
}
.dialog header{
position:relative;
margin-bottom:10px;
}
.dialog header h3 {
padding:0;
margin:0;
}
.dialog header .close {
position:absolute;
top:0;
right:0;
}
http://codepen.io/chrisgonzalez/pen/spCGy
Part 2: CSS
Monday, July 29, 13
Example 4: A dialog with two states
http://codepen.io/chrisgonzalez/pen/spCGy
Preview!
Monday, July 29, 13
Example 4: A dialog with two states
.dialog{
position:relative;
width:50%;
margin:10% auto;
background:#ffffff;
padding:20px;
border-radius:10px;
box-shadow:0px 0px ... ;
opacity:0;
z-index:-1;
}
.dialog header{
position:relative;
margin-bottom:10px;
}
.dialog.active {
opacity:1;
z-index:1;
}
.dialog header h3 {
padding:0;
margin:0;
}
.dialog header .close {
position:absolute;
top:0;
right:0;
}
http://codepen.io/chrisgonzalez/pen/aLEdB
Part 3: Adding default and active statesPart 3: Adding default and active states
Monday, July 29, 13
Example 4: A dialog with two states
.dialog{
...... (same as before)
opacity:0;
z-index:-1;
transition:opacity .5s, z-index 0s linear .5s;
}
.dialog.active {
opacity:1;
z-index:1;
transition:opacity .5s;
}
http://codepen.io/chrisgonzalez/pen/jaImd
Part 3: Adding transitions
Monday, July 29, 13
CSS Detective: Dev Tools are your friend :)
Inspect your HTML
See how the CSS
is applied!
Debug w/ line
numbers!
Monday, July 29, 13
CSS Detective: Do a library background check
IS IT SIMPLE and SEMANTIC?
Inspect the HTML, CSS, and JavaScript
IS IT EASY TO UNDERSTAND?
Is it well documented? A good library is easy to
customize and extend.
IS IT THE RIGHT TOOL FOR YOU?
Does it use HTML, CSS, JavaScript appropriately? Or
does it apply visual styles 100% in JS, clutter your DOM,
and provide an incomprehensible set of CSS rules?
Monday, July 29, 13

Más contenido relacionado

Similar a CSS Master Class: Part 1

Teams, styles and scalable applications
Teams, styles and scalable applicationsTeams, styles and scalable applications
Teams, styles and scalable applicationsVittorio Vittori
 
Lone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AngleLone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AnglePablo Godel
 
Pragmatic Responsive Web Design
Pragmatic Responsive Web DesignPragmatic Responsive Web Design
Pragmatic Responsive Web DesignJohn Tsevdos
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignCantina
 
Dapper Drupal - Custom Tailored Drupal Themes
Dapper Drupal - Custom Tailored Drupal ThemesDapper Drupal - Custom Tailored Drupal Themes
Dapper Drupal - Custom Tailored Drupal Themeskilltheliterate
 
Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web DesignClarissa Peterson
 
Quick tips to get started - Everbody has a role to play in digital accessibil...
Quick tips to get started - Everbody has a role to play in digital accessibil...Quick tips to get started - Everbody has a role to play in digital accessibil...
Quick tips to get started - Everbody has a role to play in digital accessibil...Denis Boudreau
 
Professional web development with libraries
Professional web development with librariesProfessional web development with libraries
Professional web development with librariesChristian Heilmann
 
Twitter Bootstrap, or why being a PHP Developer is a bad idea
Twitter Bootstrap, or why being a PHP Developer is a bad ideaTwitter Bootstrap, or why being a PHP Developer is a bad idea
Twitter Bootstrap, or why being a PHP Developer is a bad ideaJason Lotito
 
Responsive Content: A CSS-based Approach - MadWorld 2015, Scott DeLoach, Clic...
Responsive Content: A CSS-based Approach - MadWorld 2015, Scott DeLoach, Clic...Responsive Content: A CSS-based Approach - MadWorld 2015, Scott DeLoach, Clic...
Responsive Content: A CSS-based Approach - MadWorld 2015, Scott DeLoach, Clic...Scott DeLoach
 
Creating Lifelike Designs with CSS3
Creating Lifelike Designs with CSS3Creating Lifelike Designs with CSS3
Creating Lifelike Designs with CSS3Meagan Fisher
 
Semanticmerge
SemanticmergeSemanticmerge
Semanticmergepsluaces
 
Introduction to HTML-CSS-Javascript.pdf
Introduction to HTML-CSS-Javascript.pdfIntroduction to HTML-CSS-Javascript.pdf
Introduction to HTML-CSS-Javascript.pdfDakshPratapSingh1
 
Introduction to Responsive Design v.2
Introduction to Responsive Design v.2Introduction to Responsive Design v.2
Introduction to Responsive Design v.2Clarissa Peterson
 
CMS Refresher: Content is King
CMS Refresher: Content is KingCMS Refresher: Content is King
CMS Refresher: Content is KingCassandra Ketrick
 
Intro to-html-backbone-angular
Intro to-html-backbone-angularIntro to-html-backbone-angular
Intro to-html-backbone-angularzonathen
 
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...Patrick Lauke
 

Similar a CSS Master Class: Part 1 (20)

Teams, styles and scalable applications
Teams, styles and scalable applicationsTeams, styles and scalable applications
Teams, styles and scalable applications
 
Lone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AngleLone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New Angle
 
Pragmatic Responsive Web Design
Pragmatic Responsive Web DesignPragmatic Responsive Web Design
Pragmatic Responsive Web Design
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web Design
 
WEB DEVELOPMENT
WEB DEVELOPMENTWEB DEVELOPMENT
WEB DEVELOPMENT
 
Dapper Drupal - Custom Tailored Drupal Themes
Dapper Drupal - Custom Tailored Drupal ThemesDapper Drupal - Custom Tailored Drupal Themes
Dapper Drupal - Custom Tailored Drupal Themes
 
Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web Design
 
Quick tips to get started - Everbody has a role to play in digital accessibil...
Quick tips to get started - Everbody has a role to play in digital accessibil...Quick tips to get started - Everbody has a role to play in digital accessibil...
Quick tips to get started - Everbody has a role to play in digital accessibil...
 
Professional web development with libraries
Professional web development with librariesProfessional web development with libraries
Professional web development with libraries
 
Twitter Bootstrap, or why being a PHP Developer is a bad idea
Twitter Bootstrap, or why being a PHP Developer is a bad ideaTwitter Bootstrap, or why being a PHP Developer is a bad idea
Twitter Bootstrap, or why being a PHP Developer is a bad idea
 
Responsive Content: A CSS-based Approach - MadWorld 2015, Scott DeLoach, Clic...
Responsive Content: A CSS-based Approach - MadWorld 2015, Scott DeLoach, Clic...Responsive Content: A CSS-based Approach - MadWorld 2015, Scott DeLoach, Clic...
Responsive Content: A CSS-based Approach - MadWorld 2015, Scott DeLoach, Clic...
 
Creating Lifelike Designs with CSS3
Creating Lifelike Designs with CSS3Creating Lifelike Designs with CSS3
Creating Lifelike Designs with CSS3
 
03 css
03 css03 css
03 css
 
Semanticmerge
SemanticmergeSemanticmerge
Semanticmerge
 
Introduction to HTML-CSS-Javascript.pdf
Introduction to HTML-CSS-Javascript.pdfIntroduction to HTML-CSS-Javascript.pdf
Introduction to HTML-CSS-Javascript.pdf
 
Introduction to Responsive Design v.2
Introduction to Responsive Design v.2Introduction to Responsive Design v.2
Introduction to Responsive Design v.2
 
CMS Refresher: Content is King
CMS Refresher: Content is KingCMS Refresher: Content is King
CMS Refresher: Content is King
 
Intro to-html-backbone-angular
Intro to-html-backbone-angularIntro to-html-backbone-angular
Intro to-html-backbone-angular
 
Untangling7
Untangling7Untangling7
Untangling7
 
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
 

Último

SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdftbatkhuu1
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation decktbatkhuu1
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CANestorGamez6
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Yantram Animation Studio Corporation
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girlsmodelanjalisharma4
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonDelhi Call girls
 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...Suhani Kapoor
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...ranjana rawat
 
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...babafaisel
 
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...Pooja Nehwal
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptxVanshNarang19
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceanilsa9823
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Douxkojalkojal131
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 

Último (20)

SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
escort service sasti (*~Call Girls in Prasad Nagar Metro❤️9953056974
escort service sasti (*~Call Girls in Prasad Nagar Metro❤️9953056974escort service sasti (*~Call Girls in Prasad Nagar Metro❤️9953056974
escort service sasti (*~Call Girls in Prasad Nagar Metro❤️9953056974
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
 
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
 
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptx
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 

CSS Master Class: Part 1

  • 1. CSS Master Class Chris Gonzalez Expert Interaction Designer chris.gonzalez@turner.com Monday, July 29, 13
  • 2. Who am I? I am an Interaction Designer. In my job, I am responsible for concepting, visual (and graphic) design, high-level system design, rapid prototyping, and front- end development Monday, July 29, 13
  • 3. Mobile Apps Site Redesign Monday, July 29, 13
  • 5. Tweet of the Union Monday, July 29, 13
  • 7. What we won’t cover • CSS Animations, Media Queries, and Responsive Design • CSS Preprocessors like SASS, SCSS, LESS • Helping you solve [some CSS problem] with [some code library] • 100% all knowledge you’ll ever need for CSS • Graphic/Visual Design Monday, July 29, 13
  • 8. What we will cover • The benefits of clean, semantic markup • Simplicity! • Writing clean, semantic CSS • Basics of selectors, cascading styles, and specificity • Designing intentionally for a dynamic world Monday, July 29, 13
  • 9. Part 1 CSS as a descriptive practice Monday, July 29, 13
  • 10. What words can we use to describe the structure of this button? Example 1 : A (not-so) simple button Monday, July 29, 13
  • 11. What words can we use to describe the visual style of this button? Example 1 : A (not-so) simple button Monday, July 29, 13
  • 12. This is how ext.js describes this button in code! Gross! Example 1 : A (not-so) simple button Monday, July 29, 13
  • 13. And this is only a fraction of the CSS used! Bad! No! Example 1 : A (not-so) simple button Monday, July 29, 13
  • 14. What words can we use to describe the structure of this dialog? Example 2 : A verbose dialog Monday, July 29, 13
  • 15. What words can we use to describe the visual style of this dialog? Example 2 : A verbose dialog Monday, July 29, 13
  • 16. Well this is how jQuery UI describes it in code.. WHY! Example 2 : A verbose dialog Monday, July 29, 13
  • 17. And this is just a portion of the CSS required! AHH! Example 2 : A verbose dialog Monday, July 29, 13
  • 18. Rule #1 KEEP IT SIMPLE and SEMANTIC CSS is only as good as your markup. Monday, July 29, 13
  • 19. This is simple, readable, and all we really need. Example 3 : A simple button <button class=”home”>Home</button> http://codepen.io/chrisgonzalez/pen/Jedvw Monday, July 29, 13
  • 20. This is also simple and readable, and all we need. Example 3 : A simple button button.home { border-radius: 8px; border: 0px; padding: 15px; font-weight: bold; font-size: 1.2em; background: #369; color: #ffffff; } http://codepen.io/chrisgonzalez/pen/Jedvw Monday, July 29, 13
  • 21. HTML : Use semantic tags! <header> <nav> <section> <aside> <article> <footer> Using semantic tags will make your code machine readable, human readable, and easier to style! HTML5 is not new! These tags are supported back to IE6 Monday, July 29, 13
  • 22. HTML : Less is more! Instead of modifying these 2043 style rules for a new button, try... xMonday, July 29, 13
  • 23. HTML : Less is more! Modifying 1 or 2 rules. Better? :) <button class=”home”>Home</button> Monday, July 29, 13
  • 24. Rule #2 CSS MASTERY IS KNOWING THE BASICS, AND USING THEM WELL. All the fancy *CSS3* stuff like animations and transitions are built to use the basics in new and exciting ways. No basics? No fancy! Monday, July 29, 13
  • 25. CSS is used to visually describe your document. You can describe things generally, or specifically. Monday, July 29, 13
  • 26. CSS Basics: Cascading! If we say it like a human, we can describe: ALL buttons: button { } The buttons in the navigation: nav button { } That specific “save” button in that one dialog: div.ThatOneDialog button.save { } Monday, July 29, 13
  • 27. CSS Basics: Cascading! All three of those style definitions will be applied in order of specificity (1st) and line number (2nd): button { } - most general, applies to ALL buttons nav button { } - kinda specific, inherits styles from above .ThatOneDialog button.save { } - very specific, inherits first button style Monday, July 29, 13
  • 28. CSS Selectors: Explain it to me in Star Wars http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html Monday, July 29, 13
  • 29. Rule #3 START GENERAL AND WORK TOWARDS SPECIFIC Starting with general style rules will help you get moving quickly and more easily identify elements that do need specific styles. Monday, July 29, 13
  • 30. CSS Selectors: Specificity Be specific with purpose #button.button.ui-dialog-button.thisisabutton { } - Bad! #dialog footer button.close { } - OK! This is better :) But do we need all that specificity? Probably not! button.close { } - Very nice, also: reusable Monday, July 29, 13
  • 31. CSS Selectors: Be intentional! Be intentional with selectors. element {} .class {} #id element[attribute=”value”] element:first-child element:nth-child(2n+1) element:before element:after Monday, July 29, 13
  • 32. Example 4: A dialog with two states <div class="dialog"> <header> <h3 class="title">This is a dialog</h3> <button class="close">(x)</button> </header> This dialog is pretty awesome. I made it myself and it only took like 10 minutes. Additionally, it's really easy to edit and restyle! </div> http://codepen.io/chrisgonzalez/pen/spCGy Part 1: Markup Monday, July 29, 13
  • 33. Example 4: A dialog with two states .dialog{ position:relative; width:50%; margin:10% auto; background:#ffffff; padding:20px; border-radius:10px; box-shadow:0px 0px ... ; } .dialog header{ position:relative; margin-bottom:10px; } .dialog header h3 { padding:0; margin:0; } .dialog header .close { position:absolute; top:0; right:0; } http://codepen.io/chrisgonzalez/pen/spCGy Part 2: CSS Monday, July 29, 13
  • 34. Example 4: A dialog with two states http://codepen.io/chrisgonzalez/pen/spCGy Preview! Monday, July 29, 13
  • 35. Example 4: A dialog with two states .dialog{ position:relative; width:50%; margin:10% auto; background:#ffffff; padding:20px; border-radius:10px; box-shadow:0px 0px ... ; opacity:0; z-index:-1; } .dialog header{ position:relative; margin-bottom:10px; } .dialog.active { opacity:1; z-index:1; } .dialog header h3 { padding:0; margin:0; } .dialog header .close { position:absolute; top:0; right:0; } http://codepen.io/chrisgonzalez/pen/aLEdB Part 3: Adding default and active statesPart 3: Adding default and active states Monday, July 29, 13
  • 36. Example 4: A dialog with two states .dialog{ ...... (same as before) opacity:0; z-index:-1; transition:opacity .5s, z-index 0s linear .5s; } .dialog.active { opacity:1; z-index:1; transition:opacity .5s; } http://codepen.io/chrisgonzalez/pen/jaImd Part 3: Adding transitions Monday, July 29, 13
  • 37. CSS Detective: Dev Tools are your friend :) Inspect your HTML See how the CSS is applied! Debug w/ line numbers! Monday, July 29, 13
  • 38. CSS Detective: Do a library background check IS IT SIMPLE and SEMANTIC? Inspect the HTML, CSS, and JavaScript IS IT EASY TO UNDERSTAND? Is it well documented? A good library is easy to customize and extend. IS IT THE RIGHT TOOL FOR YOU? Does it use HTML, CSS, JavaScript appropriately? Or does it apply visual styles 100% in JS, clutter your DOM, and provide an incomprehensible set of CSS rules? Monday, July 29, 13