美文网首页
2019-07-23sass 使用

2019-07-23sass 使用

作者: 半眼鱼 | 来源:发表于2019-07-23 17:49 被阅读0次

    1.新建文件global.scss,引入一下文件:

    @import "./var";
    @import "mixin";
    @import "./common";
    @import "./vant-theme";
    

    2.在_var文件中声明全局使用的样式如下某些:

    $red: #db3d3c;
    $gray-deep: #999;
    

    3.在mixin文件中声明全局使用的样式如下某些:

    @mixin one-border($direction: bottom){
        position: relative;
    
        &::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 200%;
            height: 200%;
            transform: scale(.5);
            transform-origin: 0 0;
            pointer-events: none;
            box-sizing: border-box;
            border-#{$direction}: 1px solid $border-color;
        }
    }
    

    4.新建文件common.scss,写入一些公共使用的.class

    5.新建文件_vant-theme.scss,写入一些公共全局修改的vant样式

    6.在main.js引入使用

    import '@/assets/scss/global.scss';
    

    相关文章

      网友评论

          本文标题:2019-07-23sass 使用

          本文链接:https://www.haomeiwen.com/subject/mjoolctx.html