Nous avons envoyé le lien de vérification/téléchargement à l'adresse "". Connectez-vous à votre boîte électronique et cliquez sur le lien pour télécharger le fichier directement.
Si vous ne trouvez pas notre message, vérifiez dans votre dossier courrier indésirable/spam.
We keep thinking we can write better CSS if we just try harder, that the next site will be clean and stay that way. This presentation shows that in fact, messy CSS is the direct result of our worst ...
We keep thinking we can write better CSS if we just try harder, that the next site will be clean and stay that way. This presentation shows that in fact, messy CSS is the direct result of our worst best-practices. We need to reexamine those assumptions with an eye to practicality and scalability as well as accessibility, standards, and fabulous design.
TT TYCSS is very messy even if you organize the code in the best possible way. Cross browser problems also arise in development. BUT did you know that JS can do everything that CSS do and HTML does? you can generate CSS+HTML at runtime in a high level that you don't even write a string of HTML or CSS, you only use JS objects, it's fast, better code and more manageable that using 3 languages (HTML, CSS and JS). No JS framework based on this exists, even Dojo and YUI still thinks that writing JS modules in JS that generate low level HTML and maintain a different CSS file for all CSS stuff it's the way, it even do searches in the document to make it work. That is not the way to DO WEB APPLICATIONS. This is what motivates me in building a JS framework based only on JS no CSS and no HTML.. If someone want to help get in contact and read something about: http://www.slideshare.net/tottys/web-application-with-just-javasc and http://www.slideshare.net/tottys/dont-code-crap-in-2012-architecture-futureIl y a 1 an
Êtes-vous sûr de vouloir
harrypotter12Excellent and very helpful. Great Slide.
Thanks for sharing. Parcel delivery from http://www.clickandsendparcel.comIl y a 1 an
Êtes-vous sûr de vouloir
Voinea Daniel at FITSCould you recommend us a site that doesn't have these problems?Il y a 1 an
Jussi JokinenIt look's clean when you specify '.media .img', but isnt't that hazardous if you have this same .img class used in multiple contexts? Now you have to always remember what have been specified for .img tag previously and possibly override. Wouldn't it be just more easier and understandable to make something like .media .media-img? Of course that leads to more classes and some duplicate css, but that would improve the intelligibility and modularity of code.Il y a 2 ans
Our Best Practices Are Killing UsPresentation Transcript
OUR BEST PRACTICES ARE KILLING US photo by Joshua Stearns Nicole SullivanWednesday, March 30, 2011
WHAT WE WILL COVER: ❖ We have a problem ❖ CSS is not to blame ❖ Tools won’t solve it, but they can helpWednesday, March 30, 2011
YUMMY DATA FROM FACEBOOKWednesday, March 30, 2011
FACEBOOK BLUE 261Wednesday, March 30, 2011
UNIQUE COLORS 548 unique hex values FacebookWednesday, March 30, 2011
COLORS 6498 color declarations FacebookWednesday, March 30, 2011
YUMMY DATA FROM SALESFORCEWednesday, March 30, 2011
paddingWednesday, March 30, 2011
3,668 padding declarationsWednesday, March 30, 2011
ARE NICOLE’S CLIENTS EXCEPTIONALLY MESSY?Wednesday, March 30, 2011
ALEXA TOP 1000 STUDY with Stoyan StefanovWednesday, March 30, 2011
h1-h6Wednesday, March 30, 2011
511 declarations setting styles for h1-h6 56% >10 9% >100Wednesday, March 30, 2011
!importantWednesday, March 30, 2011
!IMPORTANT 518 declarations using important 12% have greater than 50Wednesday, March 30, 2011
floatWednesday, March 30, 2011
733 declarations floated elements 56% > 10 13% > 100Wednesday, March 30, 2011
font-sizeWednesday, March 30, 2011
FONT-SIZE 889 declarations changed the font-size 78% >10 23% >100Wednesday, March 30, 2011
DOES THIS APPLY TO YOU? Do your websites have the same issues? WorkshopWednesday, March 30, 2011
SO, DUPLICATION IS A PROBLEM AT: ❖ Facebook ❖ Salesforce ❖ w3c ❖ Box.net ❖ the Alexa Top 1000 sites ❖ Government websites ❖ Small and large businessesWednesday, March 30, 2011
INSANITY: doing the same thing over and over and expecting different resultsWednesday, March 30, 2011
STOP POINTING FINGERS the truth is, we all have this problem http://www.flickr.com/photos/illumiquest/2749137895/sizes/l/in/photostream/Wednesday, March 30, 2011
“JAVASCRIPT DOESN’T SUCK You’re just doing it wrong.” -- Douglas CrockfordWednesday, March 30, 2011
CSS “JAVASCRIPT DOESN’T SUCK You’re just doing it wrong.” -- Douglas CrockfordWednesday, March 30, 2011
ABOUT CSS CSS (much like JS) will let you do anything (no matter how stupid) wheeee!Wednesday, March 30, 2011
THE POINT IS... That we don’t have to do stupid things, just because we can.Wednesday, March 30, 2011
SO, WHAT ARE THE STUPID THINGS? Best Practice MythsWednesday, March 30, 2011
THREE BEST PRACTICE MYTHS: ❖ Don’t add any extra elements ❖ Don’t add classes (Classitis! Ahhh!) ❖ Use descendent selectors exclusivelyWednesday, March 30, 2011
WHAT HAPPENS NEXT? SPECIFICITY WARSWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSIONWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION elements & pseudo elementsWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION classes elements & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION IDs classes elements & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION inline IDs classes elements & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION #sidebar ul li a.myclass:hover{} inline IDs classes elements & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION #sidebar ul li a.myclass:hover{} inline IDs classes elements 3 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION #sidebar ul li a.myclass:hover{} inline IDs classes elements 2 3 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION #sidebar ul li a.myclass:hover{} inline IDs classes elements 1 2 3 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION #sidebar ul li a.myclass:hover{} inline IDs classes elements 0 1 2 3 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
SPECIFICITY - THE SIMPLE VERSION #sidebar ul li a.myclass:hover{} inline IDs classes elements 0 1 2 3 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
UNIVERSAL SELECTOR * {} inline IDs classes elements & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
UNIVERSAL SELECTOR * {} inline IDs classes elements 0 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
UNIVERSAL SELECTOR * {} inline IDs classes elements 0 0 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
UNIVERSAL SELECTOR * {} inline IDs classes elements 0 0 0 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
UNIVERSAL SELECTOR * {} inline IDs classes elements 0 0 0 0 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements 0 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements 1 0 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements 0 1 0 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements 0 0 1 0 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements 10 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements 0 10 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements 0 0 10 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CONCATENATING SPECIFICITY .item{color: blue;} ul li li li li li li li li li{color: red;} inline IDs classes elements 0 0 0 10 & pseudo classes & pseudo elements & attributesWednesday, March 30, 2011
CLASS ORDER <p class=”message error”>Borken!</p>Wednesday, March 30, 2011
CLASS ORDER The order of the classes makes no difference. <p class=”message error”>Borken!</p>Wednesday, March 30, 2011
WHAT IS HAPPENING WITH THE SPECIFICITY? h3{...} #sidebar h3{...} #sidebar .account h3{...}Wednesday, March 30, 2011
WHAT IS HAPPENING WITH THE SPECIFICITY? h3{...} 0 0 0 1 #sidebar h3{...} #sidebar .account h3{...}Wednesday, March 30, 2011
WHAT IS HAPPENING WITH THE SPECIFICITY? h3{...} 0 0 0 1 #sidebar h3{...} 0 1 0 1 #sidebar .account h3{...}Wednesday, March 30, 2011
WHAT IS HAPPENING WITH THE SPECIFICITY? h3{...} 0 0 0 1 #sidebar h3{...} 0 1 0 1 #sidebar .account h3{...} 0 1 1 1Wednesday, March 30, 2011
THE SITE HAS A WEATHER MODULE IN THE SIDEBAR h2 h3 #sidebar .weatherMod h3{ color: #fff; text-transform: uppercase; }Wednesday, March 30, 2011
IMAGINE YOU RECEIVED THIS WIREFRAME h3 MORN NOON EVENING NIGHT h3 27° 35° 38° 30°Wednesday, March 30, 2011
IMAGINE YOU RECEIVED THIS WIREFRAME h3 MORN NOON EVENING NIGHT h3 27° 35° 38° 30° What if the visual designer decided that fewer users would be interested in the by-hour weather, so those titles should be smaller and not boldWednesday, March 30, 2011
NOTICE ANYTHING ABOUT NESTING & SPECIFICITY? h3 MORN NOON EVENING NIGHT h3 27° 35° 38° 30° #sidebar .weatherMod h3{} #sidebar .weatherMod .hourly h3{}Wednesday, March 30, 2011
NOTICE ANYTHING ABOUT NESTING & SPECIFICITY? h3 MORN NOON EVENING NIGHT h3 27° 35° 38° 30° #sidebar .weatherMod h3{} 0 1 1 1 #sidebar .weatherMod .hourly h3{}Wednesday, March 30, 2011
SIX MONTHS LATER, IT GETS COMPLICATED ❖ Specificity grows over time ❖ Difficult to tell which rules will take precedence ❖ Developers end up coding by firebugWednesday, March 30, 2011
WHAT HAPPENS WHEN... there are no more ways to make a rule more specific than the one you are trying to override?Wednesday, March 30, 2011
<h3 style=”color: red; font-weight: bold; font-size: 20px;”>My shiny new heading level 3</h3> WHAT HAPPENS WHEN... there are no more ways to make a rule more specific than the one you are trying to override?Wednesday, March 30, 2011
<h3 style=”color: red; font-weight: bold; font-size: 20px;”>My shiny new heading level 3</h3> WHAT HAPPENS WHEN... there are no more ways to make a rule more specific than the one you are trying to override? 1 0 0 0Wednesday, March 30, 2011
AND THEN ANOTHER DEVELOPER SAYS... “this is gross! we should not be using inline-styles” but, at this point, what choice to they have left?Wednesday, March 30, 2011
#sidebar .weatherMod .hourly .tuesday h3{color: blue !important;} YOU MIGHT THINK !IMPORTANT WOULD END the specificity war, not so.Wednesday, March 30, 2011
#sidebar .weatherMod .hourly .tuesday h3{color: blue !important;} YOU MIGHT THINK !IMPORTANT WOULD END the specificity war, not so. 0 0 0 0Wednesday, March 30, 2011
#sidebar .weatherMod .hourly .tuesday h3{color: blue !important;} YOU MIGHT THINK !IMPORTANT WOULD END the specificity war, not so. 0 0 0 0Wednesday, March 30, 2011
#sidebar .weatherMod .hourly .tuesday h3{color: blue !important;} YOU MIGHT THINK !IMPORTANT WOULD END the specificity war, not so. 0 1 3 1 0 0 0 0Wednesday, March 30, 2011
HOSTILE CODE ENVIRONMENT ❖ Two layers develop ❖ Specificity grows over time (more and more rules become important). ❖ Even more difficult to tell which rules will take precedence ❖ Developers always code by firebug ❖ Eventually, it becomes impossible to get the look and feel you want.Wednesday, March 30, 2011
SPECIFICITY AT IT’S WORST normal IDs Classes ElementsWednesday, March 30, 2011
SPECIFICITY AT IT’S WORST inline Inline Styles normal IDs Classes ElementsWednesday, March 30, 2011
SPECIFICITY AT IT’S WORST !important IDs Classes Elements inline Inline Styles normal IDs Classes ElementsWednesday, March 30, 2011
#sidebar A Normal Heading Level 3Wednesday, March 30, 2011
HOW DO WE SOLVE THESE PROBLEMS? Examine our best practice myths rationally ❖ Add non-semantic elements judiciously ❖ Keep specificity as low as possible ❖ Abstract repeating visual patterns ❖ Use specificity to define your architectureWednesday, March 30, 2011
MEDIA BLOCK EXAMPLEWednesday, March 30, 2011
ALL OF THESE ARE THE SAME OBJECTWednesday, March 30, 2011
WHAT DO WE KNOW? ❖ Can be nested ❖ Optional right button ❖ Must clearfixWednesday, March 30, 2011
WHAT DON’T WE KNOW? ❖ Image width and decoration vary ❖ Right content is unknown ❖ Width unknownWednesday, March 30, 2011
SEPARATE STRUCTURE FROM CHROMEWednesday, March 30, 2011
A FEW LINES OF HTML... <div class="media attribution"> <a href="http://twitter.com/stubbornella" class="img"> <img src="mini.jpg" alt="Stubbornella" /> </a> <div class="bd">@Stubbornella 14 minutes ago</div> </div>Wednesday, March 30, 2011
4 LINES OF CSS... _Wednesday, March 30, 2011
Wednesday, March 30, 2011
HTML SIZE reduced by 50% by Stefan ParkerWednesday, March 30, 2011
“Due to these efforts, we cut our average CSS bytes per page by 19% (after gzip) and HTML bytes per page by 44% (before gzip).” Jason Sobel http://www.facebook.com/note.php?note_id=307069903919Wednesday, March 30, 2011
Wednesday, March 30, 2011
GREAT DEVELOPERS CAN BUILD AMAZING THINGS if we move worst-best practices out of our wayWednesday, March 30, 2011
Thanks for sharing.
Parcel delivery from http://www.clickandsendparcel.com Il y a 1 an