Yo : ./lib/widget/yo-doublelist.scss
源代码
源代码
@charset "utf-8"; // 定义doublelist的基础构造 @mixin _doublelist { @include fullscreen; @include flexbox; > .item { position: relative; min-width: .1rem; min-height: 2rem; height: 100%; &:first-child { width: map-get($doublelist, aside-width); @include order(map-get($doublelist, aside-order)); } &:last-child { @include flex; } } } /** * @module widget * @method yo-doublelist * @version 1.8.6 * @description 构造yo-doublelist的自定义使用方法(原yo-dblist) * @demo http://doyoe.github.io/Yo/demo/widget/yo-doublelist.html * @param {String} $name 定义扩展名称 <1.3.1> * @param {Length} $aside-width 侧边栏宽度 <1.3.1> * @param {Integer} $aside-order 侧边栏顺序 <1.3.1> */ @mixin yo-doublelist( $name: default, $aside-width: default, $aside-order: default) { // 区别是否新增实例还是修改本身 $name: if($name == default, "", "-#{$name}"); // 如果值为default,则取config的定义 @if $aside-width == default { $aside-width: map-get($doublelist, aside-width); } @if $aside-order == default { $aside-order: map-get($doublelist, aside-order); } .yo-doublelist#{$name} { > .item { &:first-child { @if $aside-width != map-get($doublelist, aside-width) { width: $aside-width; } @if $aside-order != map-get($doublelist, aside-order) { @include order($aside-order); } } } // 增量扩展 @content; } } // 调用本文件时载入doublelist基础构造 .yo-doublelist { @include _doublelist; }