//设置字体大小
@mixin font($s:14px,$h:1.5,$f:microsoft yahei){
    font:$s/#{$h} $f;
}

//参数(方向,大小,颜色),默认:向下,10px,红色
%arrow{
    width:;
    height:;
    line-height:;
    font-size:;
    overflow:hidden;
    display: inline-block;
}
@mixin arrow($dir:bottom,$size:10px,$color:red){
    @extend %arrow;    border:#{$size} dotted transparent;
    @if $dir=="top"{
        border-bottom:#{$size} dotted #{$color};
        border-top:0 none;
    }@else if $dir=="right"{
        border-left:#{$size} dotted #{$color};
        border-right:0 none;
    }
    @else if $dir=="bottom"{
        border-top:#{$size} dotted #{$color};
        border-bottom:0 none;
    }
    @else if $dir=="left"{
        border-right:#{$size} dotted #{$color};
        border-left:0 none;
    }
}

.arrow-top{
    @include arrow(top);
}
.arrow-right{
    @include arrow(right);
}
.arrow-bottom{
    @include arrow;
}
.arrow-left{
    @include arrow(left);
}

sass中常用mixin的更多相关文章

  1. Sass中常用的函数

    字符串函数 To-upper-case() 函数将字符串小写字母转换成大写字母 To-lower-case() 函数 与 To-upper-case() 刚好相反,将字符串转换成小写字母 数字函数 S ...

  2. Sass中的mixin,function,extend

    Mixins: 用于相类似的css属性将会被使用多次,每次调用时仅仅有小的参数改变: Function 用于计算得出相关值: Extend 有一批属性完全匹配时,应该使用extend

  3. sass中@的作用

    总结一下sass中用到@的地方. 1.继承@extend SASS允许一个选择器,继承另一个选择器.比如,现有class1: .class1 { border: 1px solid #ddd; } c ...

  4. sass中mixin常用的CSS3

    圆角border-radius @mixin rounded($radius){ -webkit-border-radius: $radius; -moz-border-radius: $radius ...

  5. Sass中的Map 详解

    Sass中的Map长什么样 Sass 的 map 常常被称为数据地图,也有人称其为数组,因为他总是以 key:value 成对的出现, Sass 的 map 长得与 JSON 极其相似. json: ...

  6. sass中 混合宏 VS 继承 VS 占位符 各自的使用时机和特点

    初学者都常常纠结于这个问题“什么时候用混合宏,什么时候用继承,什么时候使用占位符?”其实他们各有各的优点与缺点,先来看看他们使用效果: a) Sass 中的混合宏使用 举例代码见 2-24 行 编译出 ...

  7. css编译工具Sass中混合宏,继承,占位符分别在什么时候使用

    //SCSS中混合宏使用 @mixin mt($var){ margin-top: $var; } .block { @include mt(5px); span { display:block; @ ...

  8. 前端框架中 “类mixin” 模式的思考

    "类 mixin" 指的是 Vue 中的 mixin,Regular 中的 implement 使用 Mixin 的目的 首先我们需要知道为什么会有 mixin 的存在? 为了扩展 ...

  9. Sass中连体符(&)的运用

    在CSS中,这种想法是无法实现的,但在Sass中,可以轻松的通过连体符&来实现.这也是我们今天要说的. 我们先来回忆一下,CSS中常见的一组样式: /*页面中链接的颜色*/ a {clolor ...

随机推荐

  1. iframe与include的区别

    iframe与include区别和使用问题 1.iframe可以用在静态和动态页面,include只能用在动态页面. 2.iframe是视图级组合,include是代码级组合. 3.iframe独立成 ...

  2. Selenium 进行web自动化测试

    1.安装火狐版本时注意,如果无法正常安装,应该点击右键---以管理员身份运行 2.安装成功后,选择工具--选项--高级--更新,停止其自动化更新 3.maven里面加载应有的selenium的组件

  3. 非刚性图像配准 matlab简单示例 demons算法

    2011-05-25 17:21 非刚性图像配准 matlab简单示例 demons算法, % Clean clc; clear all; close all; % Compile the mex f ...

  4. 用来理解 Java 编程语言的 8 个图表

    原文地址: http://www.oschina.net/news/44438/top-8-diagrams-for-understanding-java 很多时候,一张图比你说 1000 个字能更有 ...

  5. 收集内存信息(总量、可用、已用、百分比)导出到csv

    #############################脚本功能及说明##################################################该脚本用来在各台ERP服务器 ...

  6. Struts2学习笔记1

     一.下载struts2.0.1 http://struts.apache.org/downloads.html,下载struts-2.0.1-all.zip,这个压缩包中包括了开发struts2所需 ...

  7. android100 自定义内容提供者

    #ContentProvider,就是来操作数据的,增删改查, * 四大组件之一 * 应用的数据库是不允许其他应用访问的 * 内容提供者的作用就是让别的应用访问到你的数据库 * 内容提供者的作用:把私 ...

  8. MySQL::SQL_MODE

    SQL_MODE可能是比较容易让开发人员和DBA忽略的一个变量,默认为空.SQL_MODE的设置其实是比较冒险的一种设置,因为在这种设置下可以允许一些非法操作,比如可以将NULL插入NOT NULL的 ...

  9. mysql自增

    主键设置自增,同时主键需要是int类型

  10. 使用普通Windows服务创建Quartz.Net服务项目

    Quartz.NET 项目地址 http://quartznet.sourceforge.net/ 源码下载地址:Quartz.Net.2.0 首先创建Quartz.Net.2.0解决方案,添加 Wi ...