SlideShare a Scribd company logo
1 of 15
If you manage big CSS, probably you
will know hundreds of frameworks to
     help developing new projects...
• Grids: Blueprint, YUI Grids, Compass, Scaffold,...
• Stylesheet meta-languages: SASS, LESS,...
• Object-Oriented: OOCSS
But...
Is anybody worried about
    the order of CSS?
         At least i do...
div.messy {
•   CSS can be written as you want, it should work, but        font-color: blue;
                                                               overflow: hidden;
    have you thought in your teammates?
                                                               display: none;
•   You could avoid some discussions with other Css            height: auto;
                                                               position: absolute;
    developers.
                                                               font-size: 15px;
                                                               text-decoration: none;
•   People who don’t play with CSS everyday can help you       box-shadow: 0 1px black;
    without add more complexity to the file.                    -webkit-border-radius: 5px;
                                                               width:100px;
•   Waste time searching properties in a reaaaally large       font-style: normal;
    CSS class.                                                 letter-spacing: -1px;
                                                               background: url(‘../lol.png’);
•   If in your team there are more than 2 developers,          margin-top: 20px;
    I think this is a must.                                    padding-bottom: 10px;
                                                               ...
                                                           }
So, this is my proposal...
      It likely shouldn’t fit for you
Classification & positioning 1/5
•   First should be the classification and positioning of
                                                           div.less_messy {
    the “box”.
                                                               clear: left;
•   Importance queue?, it could be:                            display: block;
                                                               position: absolute;
    - clear                                                    top: 4px;
    - display                                                  right: 3px;
    - position                                                 bottom: 5px;
    - top || right || bottom || left                           left: 2px;
    - z-index                                                  z-index: 10;
    - float                                                     float: none;
    - overflow                                                  overflow: auto;
    - vertical-align
    ...                                                        ...
                                                           }
•   As we know, some properties depend on previous ones.
Dimension 2/5


•   Now is time to declare the object dimensions.
                                                                 div.less_messy {
•   The list is:                                                   ...
    - width (min|max)                                                width: 150px;
    - height (min|max)                                               height: 20px;
    - padding                                                        padding: 10px 5px 3px;
    - margin                                                         margin: 3px;
                                                                     ...
•   It’s true that margin property should be in positioning      }
    chapter, but I’ve always thought it has to be written with
    height, width and padding (mania?).
Box 3/5
•   Is box a pretty good title name? I’m not really sure, but we
    are going to style it ;).
                                                                   div.less_messy {
•   SOME of these properties would be:                               ...
    - background                                                       background: red;
    - box-shadow                                                       box-shadow: 0 1px black;
    - border                                                           border: none;
    - zoom                                                             translate: rotate(45deg);
    - translate                                                        border-radius: 3px;
    - border-radius                                                    ...
    - border-image
    ...                                                            }

•   There is no importance of order...
Text 4/5

•   And almost last, but no less important.

                                                 div.less_messy {
•   Just a few of them:
                                                   ...
    - font                                           font: normal 11px Arial;
    - color
                                                     color: rgba(0,0,0,0.7);
    - text-decoration
                                                     text-decoration: none;
    - letter-spacing
                                                     line-height: 11px;
    - text-transform
    - line-height                                    text-transform: uppercase;
    - text-align                                     ...
    - word-spacing
    ...
                                                 }

•   A great idea is put color after font, why?
    I don’t know, who cares?
div.less_messy {
End 5/5                                                         clear: left;
                                                                display: block;
                                                                position: absolute;
•   There are some (... several) of properties do not           top: 4px;
                                                                right: 3px;
    specified here, like list, table,... don’t worry, just       bottom: 5px;
    order yourself to keep clean your CSS.                      left: 2px;
                                                                z-index: 10;
                                                                float: none;
•   This is an example of CSS order guide.                      overflow: auto;
                                                                width: 150px;
                                                                height: 20px;
•   Let’s make it clear together.                               padding: 10px 5px 3px;
                                                                margin: 3px;
                                                                background: red;
                                                                box-shadow: 0 1px black;
                                                                border: none;
                                                                translate: rotate(45deg);
                                                                border-radius: 3px;
                                                                font: normal 11px Arial;
                                                                color: rgba(0,0,0,0.7);
                                                                text-decoration: none;

•   Some advices? why not, go next slide.                       line-height: 11px;

                                                                text-transform: uppercase;

                                                            }
Advices! 1/2

    •   Try to avoid using long style of the property, e.g. border, margin, etc.

        border-color: red;
        border-style: solid;
        border-width: 1px;

        border: 1px solid red;



    •   But if you want to change just a single property with a new class (e.g.), it’s
        time to use minified property...
        border: 1px solid blue;

        border-color: blue;
Advices! 2/2

    •   There are some specific CSS3 properties for each browser, write all followed:
        translate: rotate(45deg);
        -moz-translate: rotate(45deg);
        -ms-translate: rotate(45deg)
        ...



    •   Do the same with the “hacks” for IE (in case you use them of course...):
        border: 1px solid blue;
        border: 1px solid white8;
        border: 1px solid white9;
Remember once more!

This is not a guide to improve the world, use just
            in case you find it useful...
Thanks! :-)
  xavijam.github.com

More Related Content

Viewers also liked

Mlibraries 3 flyer March 2011
Mlibraries 3 flyer March 2011Mlibraries 3 flyer March 2011
Mlibraries 3 flyer March 2011m-libraries
 
Evolving content for mobile delivery report march 2011
Evolving content for mobile delivery report march 2011Evolving content for mobile delivery report march 2011
Evolving content for mobile delivery report march 2011m-libraries
 
M libraries2 beds uni mlibraries seminar May 2010
M libraries2 beds uni mlibraries seminar May 2010M libraries2 beds uni mlibraries seminar May 2010
M libraries2 beds uni mlibraries seminar May 2010m-libraries
 
Mlibraries 3 ebooks in he opportunities and challenges March 2011
Mlibraries 3 ebooks in he opportunities and challenges March 2011Mlibraries 3 ebooks in he opportunities and challenges March 2011
Mlibraries 3 ebooks in he opportunities and challenges March 2011m-libraries
 
Mlibraries 3 workshop leaners on the move a developers view March 2011
Mlibraries 3 workshop leaners on the move a developers view March 2011Mlibraries 3 workshop leaners on the move a developers view March 2011
Mlibraries 3 workshop leaners on the move a developers view March 2011m-libraries
 
Mlibraries2 ou library mlibraries seminar May 2010
Mlibraries2 ou library mlibraries seminar May 2010Mlibraries2 ou library mlibraries seminar May 2010
Mlibraries2 ou library mlibraries seminar May 2010m-libraries
 
Mlibraries 3 workshop the role of mobile in research & teaching March 2011
Mlibraries 3 workshop the role of mobile in research & teaching March 2011Mlibraries 3 workshop the role of mobile in research & teaching March 2011
Mlibraries 3 workshop the role of mobile in research & teaching March 2011m-libraries
 

Viewers also liked (7)

Mlibraries 3 flyer March 2011
Mlibraries 3 flyer March 2011Mlibraries 3 flyer March 2011
Mlibraries 3 flyer March 2011
 
Evolving content for mobile delivery report march 2011
Evolving content for mobile delivery report march 2011Evolving content for mobile delivery report march 2011
Evolving content for mobile delivery report march 2011
 
M libraries2 beds uni mlibraries seminar May 2010
M libraries2 beds uni mlibraries seminar May 2010M libraries2 beds uni mlibraries seminar May 2010
M libraries2 beds uni mlibraries seminar May 2010
 
Mlibraries 3 ebooks in he opportunities and challenges March 2011
Mlibraries 3 ebooks in he opportunities and challenges March 2011Mlibraries 3 ebooks in he opportunities and challenges March 2011
Mlibraries 3 ebooks in he opportunities and challenges March 2011
 
Mlibraries 3 workshop leaners on the move a developers view March 2011
Mlibraries 3 workshop leaners on the move a developers view March 2011Mlibraries 3 workshop leaners on the move a developers view March 2011
Mlibraries 3 workshop leaners on the move a developers view March 2011
 
Mlibraries2 ou library mlibraries seminar May 2010
Mlibraries2 ou library mlibraries seminar May 2010Mlibraries2 ou library mlibraries seminar May 2010
Mlibraries2 ou library mlibraries seminar May 2010
 
Mlibraries 3 workshop the role of mobile in research & teaching March 2011
Mlibraries 3 workshop the role of mobile in research & teaching March 2011Mlibraries 3 workshop the role of mobile in research & teaching March 2011
Mlibraries 3 workshop the role of mobile in research & teaching March 2011
 

Similar to Messy css

Simplify your CSS with Stylus and Nib
Simplify your CSS with Stylus and NibSimplify your CSS with Stylus and Nib
Simplify your CSS with Stylus and NibChristian Joudrey
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPressJustin Carmony
 
JDRF: Improving Lives. Curing Type 1 Diabetes
JDRF: Improving Lives. Curing Type 1 DiabetesJDRF: Improving Lives. Curing Type 1 Diabetes
JDRF: Improving Lives. Curing Type 1 Diabetesstella6copeland43
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
Html standards presentation
Html standards presentationHtml standards presentation
Html standards presentationTiago Cardoso
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperWynn Netherland
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandThemePartner
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3 Wynn Netherland
 
HTML and CSS Help I have an assignment where I need to recreate th.pdf
HTML and CSS Help  I have an assignment where I need to recreate th.pdfHTML and CSS Help  I have an assignment where I need to recreate th.pdf
HTML and CSS Help I have an assignment where I need to recreate th.pdfpratyushraj61
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)elliando dias
 
HTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsHTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsMo Jangda
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS LayoutZoe Gillenwater
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]ThemePartner
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
 

Similar to Messy css (20)

Simplify your CSS with Stylus and Nib
Simplify your CSS with Stylus and NibSimplify your CSS with Stylus and Nib
Simplify your CSS with Stylus and Nib
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPress
 
JDRF: Improving Lives. Curing Type 1 Diabetes
JDRF: Improving Lives. Curing Type 1 DiabetesJDRF: Improving Lives. Curing Type 1 Diabetes
JDRF: Improving Lives. Curing Type 1 Diabetes
 
Sass compass
Sass compassSass compass
Sass compass
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Html standards presentation
Html standards presentationHtml standards presentation
Html standards presentation
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day Deutschland
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
HTML and CSS Help I have an assignment where I need to recreate th.pdf
HTML and CSS Help  I have an assignment where I need to recreate th.pdfHTML and CSS Help  I have an assignment where I need to recreate th.pdf
HTML and CSS Help I have an assignment where I need to recreate th.pdf
 
Cloudstack UI Customization
Cloudstack UI CustomizationCloudstack UI Customization
Cloudstack UI Customization
 
Css3
Css3Css3
Css3
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
 
HTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsHTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwords
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS Layout
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]
 
CSS and Layout
CSS and LayoutCSS and Layout
CSS and Layout
 
DotNetNuke World CSS3
DotNetNuke World CSS3DotNetNuke World CSS3
DotNetNuke World CSS3
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
 

Recently uploaded

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 

Recently uploaded (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 

Messy css

  • 1. If you manage big CSS, probably you will know hundreds of frameworks to help developing new projects...
  • 2. • Grids: Blueprint, YUI Grids, Compass, Scaffold,... • Stylesheet meta-languages: SASS, LESS,... • Object-Oriented: OOCSS
  • 4. Is anybody worried about the order of CSS? At least i do...
  • 5. div.messy { • CSS can be written as you want, it should work, but font-color: blue; overflow: hidden; have you thought in your teammates? display: none; • You could avoid some discussions with other Css height: auto; position: absolute; developers. font-size: 15px; text-decoration: none; • People who don’t play with CSS everyday can help you box-shadow: 0 1px black; without add more complexity to the file. -webkit-border-radius: 5px; width:100px; • Waste time searching properties in a reaaaally large font-style: normal; CSS class. letter-spacing: -1px; background: url(‘../lol.png’); • If in your team there are more than 2 developers, margin-top: 20px; I think this is a must. padding-bottom: 10px; ... }
  • 6. So, this is my proposal... It likely shouldn’t fit for you
  • 7. Classification & positioning 1/5 • First should be the classification and positioning of div.less_messy { the “box”. clear: left; • Importance queue?, it could be: display: block; position: absolute; - clear top: 4px; - display right: 3px; - position bottom: 5px; - top || right || bottom || left left: 2px; - z-index z-index: 10; - float float: none; - overflow overflow: auto; - vertical-align ... ... } • As we know, some properties depend on previous ones.
  • 8. Dimension 2/5 • Now is time to declare the object dimensions. div.less_messy { • The list is: ... - width (min|max) width: 150px; - height (min|max) height: 20px; - padding padding: 10px 5px 3px; - margin margin: 3px; ... • It’s true that margin property should be in positioning } chapter, but I’ve always thought it has to be written with height, width and padding (mania?).
  • 9. Box 3/5 • Is box a pretty good title name? I’m not really sure, but we are going to style it ;). div.less_messy { • SOME of these properties would be: ... - background background: red; - box-shadow box-shadow: 0 1px black; - border border: none; - zoom translate: rotate(45deg); - translate border-radius: 3px; - border-radius ... - border-image ... } • There is no importance of order...
  • 10. Text 4/5 • And almost last, but no less important. div.less_messy { • Just a few of them: ... - font font: normal 11px Arial; - color color: rgba(0,0,0,0.7); - text-decoration text-decoration: none; - letter-spacing line-height: 11px; - text-transform - line-height text-transform: uppercase; - text-align ... - word-spacing ... } • A great idea is put color after font, why? I don’t know, who cares?
  • 11. div.less_messy { End 5/5 clear: left; display: block; position: absolute; • There are some (... several) of properties do not top: 4px; right: 3px; specified here, like list, table,... don’t worry, just bottom: 5px; order yourself to keep clean your CSS. left: 2px; z-index: 10; float: none; • This is an example of CSS order guide. overflow: auto; width: 150px; height: 20px; • Let’s make it clear together. padding: 10px 5px 3px; margin: 3px; background: red; box-shadow: 0 1px black; border: none; translate: rotate(45deg); border-radius: 3px; font: normal 11px Arial; color: rgba(0,0,0,0.7); text-decoration: none; • Some advices? why not, go next slide. line-height: 11px; text-transform: uppercase; }
  • 12. Advices! 1/2 • Try to avoid using long style of the property, e.g. border, margin, etc. border-color: red; border-style: solid; border-width: 1px; border: 1px solid red; • But if you want to change just a single property with a new class (e.g.), it’s time to use minified property... border: 1px solid blue; border-color: blue;
  • 13. Advices! 2/2 • There are some specific CSS3 properties for each browser, write all followed: translate: rotate(45deg); -moz-translate: rotate(45deg); -ms-translate: rotate(45deg) ... • Do the same with the “hacks” for IE (in case you use them of course...): border: 1px solid blue; border: 1px solid white8; border: 1px solid white9;
  • 14. Remember once more! This is not a guide to improve the world, use just in case you find it useful...
  • 15. Thanks! :-) xavijam.github.com

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n