SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
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
 
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
 
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
 

Dernier (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.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...
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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
 
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
 
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
 

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

Notes de l'éditeur

  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