scss color_loops.scss

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss color_loops.scss相关的知识,希望对你有一定的参考价值。

// color palette.
$white: #ffffff;
$grey: #ccc;
$greyblue: #5C6F7B;
$blackblue: #162934;
$lightblue: #29AAE2;
$darkblue: #006FAB;
$lightgreen: #B1BA1D;
$darkgreen: #8D8A00;
$brightred: #C4122F;
$darkred: #891F02;
$brick: #B94A48;
$lightpurple: #5E2351;
$darkpurple: #492D3C;
$lightorange: #F59F1A;
$darkorange: #D06F19;
$lightpink: #C9006B;
$maroon: #7C0040;

// some specific colors from the palette.
$chart-colors: (
  $lightpink,
  $blackblue,
  $maroon,
  $darkgreen,
  $darkpurple,
  $darkred,
  $darkorange,
  $maroon,
  $blackblue,
  $brick,
  $lightgreen,
  $brightred );

// get the length of the palette for the @for loop.
$chart-color-count: length($chart-colors);


@mixin chart-colors($type) {
  @if $type == svg {
    @for $i from 1 through $chart-color-count {
      $current-color: nth($chart-colors, $i);
      &:nth-of-type(#{$i}) { fill: rgba($current-color, .7); }
    }//@for
  }//@if

  @if $type == element {
    @for $i from 1 through $chart-color-count {
      $current-color: nth($chart-colors, $i);
      &:nth-of-type(#{$i}) .skill-bar { background: rgba($current-color, .7); }
    }//@for
  }//@if
}//@mixin

以上是关于scss color_loops.scss的主要内容,如果未能解决你的问题,请参考以下文章

scss scss_vertical-center.scss

scss scss_sass_if.scss

scss scss_sass创建-classes.scss

scss 修复基础bug基金会scss基础_functions.scss

导入基本部分 scss 时避免复制 [重复]

分离 SCSS 和 CSS 文件