Yo 源文件
Yo 是一款基于 Mobile First 理念而设计的 CSS Framework,当然,它也适应于PC端的高级浏览器;其具备轻量,易用,快速且高度强大的自定义能力
Yo 是一款基于 Mobile First 理念而设计的 CSS Framework,当然,它也适应于PC端的高级浏览器;其具备轻量,易用,快速且高度强大的自定义能力
@charset "utf-8"; // 定义score的基础构造 @mixin _score { position: relative; width: map-get($score, item-width) * 5; height: map-get($score, item-height); overflow: hidden; &, > .index { display: inline-block; background: url(#{map-get($setting, bgimg-domain)}#{map-get($score, url)}) repeat-x; @if map-get($score, item-height) != null { background-size: auto map-get($score, item-height) * 2; } } > .index { height: 100%; background-position: 0 unquote(-#{map-get($score, item-height)}); line-height: 10; vertical-align: top; } } /** * @module element * @method yo-score * @version 1.3.1 * @description 构造评分展示的自定义使用方法 * @demo http://doyoe.github.io/Yo/demo/element/yo-score.html * @param {String} $name 定义扩展名称 {add:1.3.1} * @param {Length} $item-width 单项宽度 {add:1.3.1} * @param {Length} $item-height 单项高度 {add:1.3.1} * @param {String} $url 背景图片url {add:1.3.1} */ @mixin yo-score( $name: default, $item-width: default, $item-height: default, $url: default) { // 区别是否新增实例还是修改本身 $name: if($name == default, "", "-#{$name}"); // 如果值为default,则取config的定义 @if $item-width == default { $item-width: map-get($score, item-width); } @if $item-height == default { $item-height: map-get($score, item-height); } @if $url == default { $url: map-get($score, url); } .yo-score#{$name} { @if $item-width != map-get($score, item-width) { width: $item-width * 5; } @if $item-height != map-get($score, item-height) { height: $item-height; } &, > .index { @if $url != map-get($score, url) { background-image: url(#{map-get($setting, bgimg-domain)}#{$url}); } @if $item-height != map-get($score, item-height) { background-size: auto $item-height * 2; } } > .index { @if $item-height != map-get($score, item-height) { background-position: 0 unquote(-#{$item-height}); } } // 增量扩展 @content; } } // 调用本文件时载入score基础构造 .yo-score { @include _score; }