SuperMonkey

Code LESS vs Code CSS

Aug 13th, 2012
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.66 KB | None | 0 0
  1. /*** Code LESS (en plus, quand on lit ça, ça veut tout dire "codez moins" :D) [564 caractères] ***/
  2. .degrade (@origin, @middle, @end) {
  3.     background: -moz-linear-gradient(
  4.         top,
  5.         @origin 0%,
  6.         @middle 25%,
  7.         @end);
  8.     background: -webkit-gradient(
  9.         linear, left top, left bottom,
  10.         from(@origin),
  11.         color-stop(0.25, @middle),
  12.         to(@end));
  13. }
  14.  
  15. .coinRond(@radius) {
  16.     -moz-border-radius: @radius;
  17.     -webkit-border-radius: @radius;
  18.     border-radius: @radius;
  19. }
  20.  
  21. .bouton1 {
  22.     .degrade(#fff, #555, #000);
  23.     .coinRond(10px);
  24. }
  25.  
  26. .bouton2 {
  27.     .degrade(#123, #456, #789);
  28.     .coinRond(6px);
  29. }
  30.  
  31. .bouton3 {
  32.     .degrade(#192, #384, #576);
  33.     .coinRond(8px);
  34. }
  35.  
  36. /*** Code CSS (taille du Code : 790 caractères) ***/
  37. bouton1{background:-moz-linear-gradient(top, #ffffff 0%, #555555 25%, #000000);background:-webkit-gradient(linear, left top, left bottom, from(#ffffff), color-stop(0.25, #555555), to(#000000));-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;}
  38. .bouton2{background:-moz-linear-gradient(top, #112233 0%, #445566 25%, #778899);background:-webkit-gradient(linear, left top, left bottom, from(#112233), color-stop(0.25, #445566), to(#778899));-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}
  39. .bouton3{background:-moz-linear-gradient(top, #119922 0%, #338844 25%, #557766);background:-webkit-gradient(linear, left top, left bottom, from(#119922), color-stop(0.25, #338844), to(#557766));-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}
  40.  
  41. /*** Même minifié, le CSS est beaucoup plus gros que le code LESS non minifié. Je crois que ça donne une bonne raison d'aimer ce langage! :D ***/
Advertisement
Add Comment
Please, Sign In to add comment