SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Último (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

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

Notas do Editor

  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