scss 一个SCSS循环,将垂直(产品供应)与图标和彩色背景相结合。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss 一个SCSS循环,将垂直(产品供应)与图标和彩色背景相结合。相关的知识,希望对你有一定的参考价值。

@mixin verticalLoop($vertical) {
  $vertical-image-path: "#{$image-path-content}/icons/verticals/";
  @each $color in color-black, color-white, color-honeycomb, color-clementine, 
 color-slushie, color-frosting, color-aloe, color-berry, color-wasabi,  
 color-grape, color-spice, color-wine, color-whale, color-honeycombLight, 
 color-clementineLight, color-slushieLight, color-frostingLight, 
 color-teaLight, color-berryLight, color-grapeLight, color-grayLightest, 
 color-grayLighter, color-grayLight, color-gray, color-grayDark, 
 color-grayDarker, color-grayDarkest {
    &.vertical-icon {
      background-image: url("#{$vertical-image-path}/#{$vertical}-color-black.svg") !important;
      &.vertical-icon-#{$color} {
        background-image: url("#{$vertical-image-path}/#{$vertical}-#{$color}.svg") !important;
      } // &.concept-icon-#{$color}
    } // &.concept-icon
  } // @each $color in  ...
}

li, div, tr {
 @each $vertical in local, adventures, amazon, at-home, citywide, deals, escapes, families, 
gourmet, nationwide, toad {
    &.#{$vertical},  &.#{$vertical} td {
      @include verticalLoop($vertical);
    } // &.#{$vertical}
  } // @each $vertical in...
} // li, div, tr

以上是关于scss 一个SCSS循环,将垂直(产品供应)与图标和彩色背景相结合。的主要内容,如果未能解决你的问题,请参考以下文章

scss 水平和垂直居中[SCSS]

scss 垂直居中[SCSS]

scss SCSS:垂直中心Mixin

将 SCSS 变量导出到 JS(自动循环变量)

scss 供应商前缀

scss Linear-Gradient SCSS Mixin使用供应商前缀快速轻松地创建背景渐变,以获得最大的浏览器支持。