Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Mixin: background-stripes #7

Open
teles opened this issue May 6, 2016 · 0 comments
Open

Mixin: background-stripes #7

teles opened this issue May 6, 2016 · 0 comments
Milestone

Comments

@teles
Copy link
Owner

teles commented May 6, 2016

Falar sobre o mixin background-stripes, que cria listras horizontais em css.

@mixin background-stripes($stripes-direction, $stripes-colors...) {
   $stripes-list: ();

   @for $i from 1 through length($stripes-colors){      
      $stripe-number-prev: #{100%/length($stripes-colors) * ($i - 1)};
      $stripe-number: #{100%/length($stripes-colors) * $i};
      $stripe-color: nth($stripes-colors, $i);

      $stripe-declaration-prev: $stripe-color $stripe-number-prev;
      $stripe-declaration: $stripe-color $stripe-number;
      $stripes-list: append($stripes-list, $stripe-declaration-prev, comma);    
      $stripes-list: append($stripes-list, $stripe-declaration, comma);
   }
   background-image: linear-gradient($stripes-direction, $stripes-list);
}
  • Exemplos de uso
  • Lógica do código do mixin
  • Falar sobre manipulação de vetores em sass
  • Falar sobre lista de argumentos em mixins sass

Importante: Se você gostou dessa ideia, deixe seu like ou comentário nessa issue.

@teles teles added this to the posts milestone May 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant