Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
CSS: more or Less 12h35 - 12h50 - Salle Miles David
CSS: more or Less      Julien RocheJava and Web engineer / trainer         Objet Direct        @rochejul                  ...
Julien Roche ■ Ingénieur d’étude Java, Web, Web Mobile / hybride chez Objet   Direct depuis 5 ans ■ Formateur / consultant...
Et pour faire la présentation …                      … racontons une jolie histoire                                       ...
Il était une fois …                      … un site Web                                      5
Sur ce site Web …                    … j’ai rencontré du CSS (… entre autre …)                                            ...
Je suis content car … (1)                ■ Le CSS permet de styliser le DOM HTML                ■ Le CSS permet de définir...
Je suis content car … (2)                ■ Le CSS possède un moteur de sélecteur                  CSS puissant            ...
Mais soudain …                 … le drame                              9
On doit faire face à…(1)                                  … du code en quantité… du code difficile à maintenir            ...
On doit faire face à…(2)                               … un manque d’outils… l’absence de variables, de fonctions       … ...
Mais une lueur d’espoir … http://lesscss.org/   https://github.com/cloudhead/less.js                                      ...
J’ai enfin un outil ! (1)           ■ Vous devez créer des fichiers avec l’extension “.less”           ■ Ensuite, vous ave...
J’ai enfin un outil ! (2)  Importer le fichier JavaScript “less.js” dans votre page, qui va compiler  à la volée vos fich...
J’ai enfin un outil ! (3)   ■ Utiliser RhinoJS / NodeJs pour compiler les fichiers Less en CSS     directement !!
Mais Less, c’est plus que ça !                 Il « étend » CSS afin de l’enrichir:                   Il offre de nouvel...
J’ai enfin des variables ! @black:                  #000; @gray:                   rgba(85, 85, 85); @white:              ...
Un exemple de site à marque blanches    Thèmes Bootstrap, se basant sur Less !!!! Merci les variables
J’ai enfin des méthodes ! (1) .text-shadow (@x, @y, @blur, @color) {     box-shadow: @x @y @blur @color;     -moz-box-shad...
J’ai enfin des méthodes ! (2) .text-shadow (@x: 0, @y: 0, @blur: 1px, @color: #000) {     box-shadow: @x @y @blur @color; ...
J’ai enfin des méthodes ! (3) .mixin (@a) when (lightness(@a) >= 50%) {     background-color: @Black; } .mixin (@a) when (...
Je peux facilement séparer mes fichiers !/* Fichier a.less */   /* Fichier b.less */@a: red;               @import-once "a...
J’ai un code structurant !// CSS                           // Lesstable {                          table {    border: 1px ...
J’ai des méthodes supplémentaires ! (1) // Commenter avec “//” !! // Variabiliser les sélecteurs @prefix: a-prefix; .style...
J’ai des méthodes supplémentaires ! (2) // Injection dans du texte @baseUrl: "http://somewhere.com"; background-image: url...
J’ai des méthodes supplémentaires ! (3)  escape(@string); // URL encodes a string  e(@string); // escape string content ...
J’ai des méthodes supplémentaires ! (4)  Et bien d’autres !    Pour manipuler / extraire des informations sur les couleu...
Et à la fin, nous avons ça:
Liens utilesDocumentation (officielle ou non)          Outilshttp://lesscss.org/#docs                       http://css2les...
Les solutions concurrentes    http://css-tricks.com/poll-results-popularity-of-css-preprocessors/                         ...
Q&A
Upcoming SlideShare
Loading in …5
×

Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CSS++more+or+Less

813 views

Published on

Il n’existe à ce jour plus une seule application Web qui n’utilise pas « CSS », ces fichiers qui permettent de styliser son application. Aujourd’hui, « CSS3 » nous permet d’écrire des applications du plus en plus attrayantes mais n’est pas encore idéal puisque nous constatons des manques comme par exemple la définition de constantes de couleurs, chose appréciable pour les sites en marque blanche. Notons également la difficulté pour factoriser et maintenir ce code.

Une lueur d’espoir est apparue, grâce à « Less ». C’est un framework qui non seulement nous facilite l’écriture de nos fichiers CSS, mais nous aide également à les maintenir et à mieux les structurer, tout en ayant des outils que nous pouvons utiliser dans nos usines logiciels.

Je suis un développeur Web, et je n’ai pas peur de dire que désormais, j’aime le CSS !

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CSS++more+or+Less

  1. 1. CSS: more or Less 12h35 - 12h50 - Salle Miles David
  2. 2. CSS: more or Less Julien RocheJava and Web engineer / trainer Objet Direct @rochejul 27 au 29 mars 2013
  3. 3. Julien Roche ■ Ingénieur d’étude Java, Web, Web Mobile / hybride chez Objet Direct depuis 5 ans ■ Formateur / consultant sur ces technologies ■ Ancien commiter officiel du projet OpenSource wiQuery ■ Des talks / articles: ■ Quickie au Devoxx 2012 ■ 3 Articles sur le magazine “Programmez” ■ 2 Talks au Human Talks Grenoble 3
  4. 4. Et pour faire la présentation … … racontons une jolie histoire 4
  5. 5. Il était une fois … … un site Web 5
  6. 6. Sur ce site Web … … j’ai rencontré du CSS (… entre autre …) 6
  7. 7. Je suis content car … (1) ■ Le CSS permet de styliser le DOM HTML ■ Le CSS permet de définir des styles selon le média ■ Le CSS permet de l’héritage des styles 7
  8. 8. Je suis content car … (2) ■ Le CSS possède un moteur de sélecteur CSS puissant ■ Et le CSS a connu énormément d’améliorations grâce à CSS3 8
  9. 9. Mais soudain … … le drame 9
  10. 10. On doit faire face à…(1) … du code en quantité… du code difficile à maintenir … une structuration complexe 10
  11. 11. On doit faire face à…(2) … un manque d’outils… l’absence de variables, de fonctions … l’absence de méthodes utilitaires 11
  12. 12. Mais une lueur d’espoir … http://lesscss.org/ https://github.com/cloudhead/less.js 12
  13. 13. J’ai enfin un outil ! (1) ■ Vous devez créer des fichiers avec l’extension “.less” ■ Ensuite, vous avez deux manières de l’utiliser 13
  14. 14. J’ai enfin un outil ! (2)  Importer le fichier JavaScript “less.js” dans votre page, qui va compiler à la volée vos fichiers Less <!DOCTYPE HTML> <html lang="fr"> <head> <!-- Metas basic --> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <meta http-equiv="Content-Language" content="fr"> <!-- StyleSheets --> <link rel="stylesheet/less" type="text/css" href="styles.less" /> <!-- JavaScripts --> <script src="less.js" type="text/javascript"></script> <!-- Title & others --> <title>Exemple très simple</title> </head> <body> <!-- ... --> </body> </html>
  15. 15. J’ai enfin un outil ! (3) ■ Utiliser RhinoJS / NodeJs pour compiler les fichiers Less en CSS directement !!
  16. 16. Mais Less, c’est plus que ça !  Il « étend » CSS afin de l’enrichir: Il offre de nouvelles syntaxes Il offre de nouvelles fonctionnalités Il offre des méthodes utilitaires
  17. 17. J’ai enfin des variables ! @black: #000; @gray: rgba(85, 85, 85); @white: rgb(255, 255, 255); body { background-color: @gray; Less nous offre la possibilité d’utiliser des variables !! } Cela est très utile pour les sites à img { marque blanche (pour pouvoir changer border: 2px dotted @black; facilement et rapidement les couleurs, la taille des éléments …) } 17
  18. 18. Un exemple de site à marque blanches Thèmes Bootstrap, se basant sur Less !!!! Merci les variables
  19. 19. J’ai enfin des méthodes ! (1) .text-shadow (@x, @y, @blur, @color) { box-shadow: @x @y @blur @color; -moz-box-shadow: @arguments; Less permet de génèrer des portions de code en fonction de paramètres -webkit-box-shadow: @arguments; } Cela permet de faire du refactoring de code et d’avoir une maintenance accrue de nos styles p.shadow { .text-shadow(0px, 0px, 1px, #00000); } 19
  20. 20. J’ai enfin des méthodes ! (2) .text-shadow (@x: 0, @y: 0, @blur: 1px, @color: #000) { box-shadow: @x @y @blur @color; -moz-box-shadow: @arguments; -webkit-box-shadow: @arguments; } p.shadow { Les paramètres d’une fonction deviennent .text-shadow(); optionnels si ces derniers ont une valeur par défaut } 20
  21. 21. J’ai enfin des méthodes ! (3) .mixin (@a) when (lightness(@a) >= 50%) { background-color: @Black; } .mixin (@a) when (lightness(@a) < 50%) { background-color: @White; } Less offre également la possibilité de mettre des conditions sur les méthodes (afin de savoir si elles .mixin (@a) { s’appliquent ou non) color: @a; } 21
  22. 22. Je peux facilement séparer mes fichiers !/* Fichier a.less */ /* Fichier b.less */@a: red; @import-once "a.less";@b: blue;@c: green; table { background-color: @a; border: 1px solid @b; color: @c; } 22
  23. 23. J’ai un code structurant !// CSS // Lesstable { table { border: 1px solid black; border: 1px solid @borderColor;} &.dotted {table.dotted { border-style: dotted; border-style: dotted; }} td {table td { background-color: @tdColor; background-color: #ffbbcc; &:hover{} background-color: @tdHoverColor;table td:hover { } background-color: #ccbbff; }} } 23
  24. 24. J’ai des méthodes supplémentaires ! (1) // Commenter avec “//” !! // Variabiliser les sélecteurs @prefix: a-prefix; .style-@{prefix} { // va devenir .style-a-prefix } // Evaluer du JavaScript (à utiliser avec précaution !!) @var: `"hello".toUpperCase() + !`; @str: "hello"; @var: ~`"@{str}".toUpperCase() + !`; 24
  25. 25. J’ai des méthodes supplémentaires ! (2) // Injection dans du texte @baseUrl: "http://somewhere.com"; background-image: url("@{baseUrl}/a.png"); // Opérations !! @base: 5%; @filler: (@base * 2); // 10% @other: (@base + @filler); // 15% @base-color: (#888 / 4); // #222 background-color: (@base-color + #111); // #333 25
  26. 26. J’ai des méthodes supplémentaires ! (3)  escape(@string); // URL encodes a string  e(@string); // escape string content  %(@string, values...); // formats a string  ceil(@number); // rounds up to an integer  floor(@number); // rounds down to an integer  percentage(@number); // converts to a %, e.g. 0.5 -> 50%  round(number, [places: 0]); // rounds a number to a number of places 26
  27. 27. J’ai des méthodes supplémentaires ! (4)  Et bien d’autres !  Pour manipuler / extraire des informations sur les couleurs  Pour convertir / extraire des données 27
  28. 28. Et à la fin, nous avons ça:
  29. 29. Liens utilesDocumentation (officielle ou non) Outilshttp://lesscss.org/#docs http://css2less.cc/http://lesscss.org/#reference http://crunchapp.net/http://coding.smashingmagazine.com/2011/ http://winless.org/09/09/an-introduction-to-less-and-comparison-to-sass/ http://wearekiss.com/simpless
  30. 30. Les solutions concurrentes http://css-tricks.com/poll-results-popularity-of-css-preprocessors/ 30
  31. 31. Q&A

×