@charset "utf-8";
$IconName: nu-icon; // 图标名
$iconClassName: nu_icon; // 图标class名

$FontName: nu-font; // 字体名
$fontClassName: nu_font; // 字体class名


@mixin iconFont($fontName, $extendName:'') { // 定义字体样式内容
    @if $extendName != ''{
        font-family: "#{$fontName}","#{$extendName}";
    } @else {
        font-family: "#{$fontName}";
    }
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal; // 小型大写
    text-transform: none;
    // line-height: 1;
}

@mixin smoothing() {
    -webkit-text-stroke-width: 0.2px; // 用长度值指定描边厚度
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@mixin fontFace($dir,$fontName) { // 设置字体
    $fontdir:"#{$dir}fonts/#{$fontName}/#{$fontName}";
    font-family: "#{$fontName}";
    font-display: block;
    src: url("#{$fontdir}.eot"); /* IE9 */
    src: url("#{$fontdir}.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
    url("#{$fontdir}.woff") format("woff"), /* chrome、firefox */
    url("#{$fontdir}.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
    url("#{$fontdir}.svg#uxfonteditor") format("svg"); /* iOS 4.1- */
}


//图标
@mixin nuIcon($dir:"../",$fontName: $IconName, $clsaaName: $iconClassName, $extendName:'') {
    @font-face {
        @include fontFace($dir,$fontName);
    }
    .#{$clsaaName} {
        @include iconFont($fontName, $extendName);
        @include smoothing();
    }
}

//字体
@mixin nuFont($dir:"../",$fontName: $FontName, $clsaaName: $fontClassName, $extendName:'') {
    @font-face {
        @include fontFace($dir,$fontName);
    }
    .#{$clsaaName} {
        @include iconFont($fontName, $extendName);
    }
}


%#{$iconClassName} { // 图标
    @include iconFont($IconName, '');
    @include smoothing();
}

%#{$fontClassName} { // 字体
    @include iconFont($FontName, '');
}
