企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## **scss** > 只列出常用的几个用法,深入学习 [传送门](https://www.sass.hk/guide/) * 嵌套规则 ```css #app{ .nav-view{ float: left; width: 200px; } p{ font-size: 16px; } a{ color: blue; &:hover{ // & 表示父级选择器 color: red; } } } ``` * 变量 ```css $c-theme: blue; // 定义 p{ background-color: $c-theme; // 引用 } ``` * 混合器 ```css @mixin radius-large { border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; } @mixin whh($w: 100px, $h: 100px){ width: $w; height: $h; line-height: $h; } // 引用 .content-view{ @include whh(200px, 300px); @include radius-large; } ``` * 继承 ```css .border-error{ border: 1px solid red; } .border-success{ @extend .border-error; border-color: green; } ``` ## **less** > 只列出常用的几个用法,深入学习 [传送门](https://less.bootcss.com/) * 嵌套规则(和 scss 差不多) * 变量 ```css @c-theme: blue; p{ background-color: @c-theme; } ``` * 混合器 ```css .radius-large { border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; } .whh(@w: 100px, @h: 100px){ width: @w; height: @h; line-height: @h; } // 引用 .content-view{ .whh(200px, 300px); .radius-large(); } ```