User:Schen13/WikiColor.sass

Code
// databases $volume-colors: ( seven-magicians: ( manga: (     1:#f28d01,      2:#db8bae,      3:#a97db2,      4:#48a7df,      5:#00a67e,      6:#a1c91b,      7:#ffc900,      8:#fbb102,      9:#f499a7,      10:#977bb7,      11:#54c1e8,      12:#00a692,      13:#83df56,      14:#fffa1c,      15:#fe8d3d,      16:#ff9ed1,      17:#d8addb,      18:#52b3e0     ) ) );

$last-volumes: ( seven-magicians : ( manga: (     japan: 18    ), light-novel: (     japan: 3    ) ) );

$series-codes: ( seven-magicians: SM );

$media-codes: ( manga: MA );

@function volume-color($series, $media, $version) { $volume-color: white; @if (map-has-key($volume-colors, $series)) { $series-media: map-get($volume-colors, $series);

@if (map-has-key($series-media, $media)) { $volumes: map-get($series-media, $media); @if (map-has-key($volumes, $version)) { $volume-color: map-get($volumes, $version); }   }  }  @return $volume-color; }

@function last-volume($series, $media, $country) { $last-volume: 0; @if (map-has-key($last-volumes, $series)) { $media-country: map-get($last-volumes, $series); @if (map-has-key($media-country, $media)) { $country-volume: map-get($media-country, $media); @if (map-has-key($country-volume, $country)) { $last-volume: map-get($country-volume, $country); }   }  }  @return $last-volume; }

$last-volume-color: ( japan: volume-color(seven-magicians, manga, 18) );

$default-color: volume-color(seven-magicians, manga, last-volume(seven-magicians, manga, japan));

@mixin base_border($color) { border: 3px solid $color; border-radius: 5px; }

.default { &-color { color: $default-color; } &-border { @include base_border($default-color); } &-bg-color { background-color: $default-color; } &-img-bg-color img { background-color: $default-color; } }

@each $series, $media-volume in $volume-colors { $series-code: map-get($series-codes, $series); @each $media, $volume-color in $media-volume { $media-code: map-get($media-codes, $media); @each $volume, $color in $volume-color { .#{$series-code} { &.#{$media-code} { &.v#{$volume} { &.v- { &border { @include base_border($color); }             &color { color: $color; }             &bg-color { background-color: $color; }             &img-bg-color img { background-color: $color; }             &img-bg-color img { background-color: $color; }           }          }        }      }    }  } }