Advertisement
aconstantino

SASS Project

Apr 10th, 2023
1,324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 1.46 KB | Software | 0 0
  1. $top-foods: ("Sugar Cane" 1898),
  2. ("Corn" 1017),
  3. ("Rice" 738),
  4. ("Wheat" 711),
  5. ("Cow Milk" 635),
  6. ("Potatoes" 374),
  7. ("Vegetables" 279),
  8. ("Soy Beans" 278),
  9. ("Cassava" 263),
  10. ("Sugar Beets" 247);
  11. $diamond-blue: rgba(0, 159, 255, .6);
  12. $sea-green: rgba(10, 165, 153, .6);
  13. $pale-green: rgba(167, 240, 213, .6);
  14. h1 {
  15.   font-family: 'Montserrat', sans-serif;
  16.   font-size: 18px;
  17.   padding-bottom: 20px;
  18.   color: #434444;
  19. }
  20.  
  21. span {
  22.   display: block;
  23. }
  24.  
  25. rect {
  26.   width: 24px;
  27.   float: left;
  28.   padding-left: 25px;
  29.   padding-top: 7px;
  30.   white-space: nowrap;
  31.   word-break: break-all;
  32.   position: relative;
  33.   bottom: 0px;
  34.   font-size: 12px;
  35.   color: #707070;
  36.   background-color: #707070;
  37.   font-family: 'Montserrat', sans-serif;
  38.   &:before {
  39.     display: inline-block;
  40.     -webkit-transform: rotate(90deg);
  41.     transform-origin: left top 0;
  42.     float: left;
  43.   }
  44.   &:after {
  45.     position: absolute;
  46.     top: -15px;
  47.     left: 0px;
  48.   }
  49. }
  50.  
  51. @each $food, $tons-produced in $top-foods{
  52.  $i: index($top-foods,($food $tons-produced));
  53.  rect:nth-child(#{$i + 1}) {
  54.    height: #{$tons-produced/3}px;
  55.  
  56.     @if($i % 3 == 0) {
  57.       background-color: fade-out($sea-green, $i*5/100);
  58.     } @else if($i % 3 == 1){
  59.       background-color: fade-out($pale-green, $i*5/100);
  60.     } @else {
  61.        background-color: fade-out($diamond-blue, $i*5/100);
  62.     }
  63.  
  64.    &:before {
  65.       content: $food;
  66.     }
  67.  
  68.      &:after {
  69.       content: $tons-produced + "m";
  70.     }
  71.  }
  72. }
Tags: sass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement