sass笔记

  1. 声明变量 通过$标识符进行命名及引用
  2. 混合器 类似vue中的函数 通过 @mixin标识定义 @include 标识调用
  3. & 父选择器标识
  4. @extend 进行继承
  5. 可嵌套
  6. 可导入 通过 @import '文件位置' 、进行导入
js 复制代码
<style>
//1 声明变量
$name: 15px;
$color: skyblue;

@mixin border-radius($num) {
  //2 类似函数
  border-radius: $num;
}
.aa {
//1 使用变量
  height: $name !important;
  background: $color !important;
  big {
    color: $color;
    font-size: 30px;
    font-weight: 700;
    & {  //3 
      width: 50px;
      background: purple;
    }

    @include border-radius(50%); // 2 调用函数
  }
}
.a2 {
  @extend .aa; //4 继承 
  margin-left: 500px;
}
</style>


<template>
  <div class="aa">
    <big>123</big>
  </div>
  <small class="a2">456</small>
</template>
相关推荐
xuhaoyu_cpp_java4 小时前
过滤器与监听器学习
java·经验分享·笔记·学习
LegendNoTitle5 小时前
计算机三级等级考试 网络技术 选择题考点详细梳理
服务器·前端·经验分享·笔记·php
Oll Correct7 小时前
实验八:验证以太网交换机的生成树协议STP
网络·笔记
_李小白7 小时前
【OSG学习笔记】Day 2: Hello Cow
笔记·学习
鹭天7 小时前
Langchain学习笔记
笔记·学习·langchain
GLDbalala8 小时前
GPU PRO 5 - 1.2 Reducing Texture Memory Usage by 2-Channel Color Encoding 笔记
笔记
IT19958 小时前
Docker笔记-对docker-compose.yml基本认识
笔记·docker·容器
猹叉叉(学习版)9 小时前
【系统分析师_知识点整理】 1.计算机系统
笔记·软考·系统分析师
CryptoPP10 小时前
开发者指南:构建实时期货黄金数据监控系统
大数据·数据结构·笔记·金融·区块链