SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

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

Hinweis der Redaktion

  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