[SCSS] Use Standard Built-in SCSS Functions for Common Operations
for in use Common Functions operations STANDARD Scss
2023-09-14 08:59:18 时间
We can use javascript for color and opacity variations, math, list and map logic or to see if something exists. SCSS includes functions for a wide range of common use cases for logic in our styles. In this lesson we look at some of the more useful color functions to improve development velocity, readability, and simplify the code. Be sure to checkout all the SCSS functions: http://sass-lang.com/documentation/Sass/Script/Functions.html
$base: #24ea12; $lighten_base: lighten($base, 25%); $darken_base: darken($base, 25%); $clb: complement($base); $cllb: complement($lighten_base); $cldb: complement($darken_base); $light-color: scale_color($base, $alpha: -50%); $dark-color: scale_color($base, $saturation: -35%); .base { background-color: $base; color: $clb; } .lighten_base { background-color: $lighten_base; color: $cllb; } .darken_base { background-color: $darken_base; color: $cldb; } .linear-gradient { background-image: linear-gradient($clb, $cllb, $cldb); color: mix($base, yellow, 25%); } .hover { background-image: linear-gradient($base, $lighten_base, $darken_base); color: mix($base, yellow, 25%); &:hover { color: transparentize(mix($base, yellow, 25%), .5); // based on given color, add 0.5 opacity } } .darken-color { color: $dark-color; } .lighten-color { color: $light-color; } .container { display: grid; grid-gap: 10px; grid-template-columns: 1fr 1fr 1fr; counter-reset: box; height: 100vh; } .box:before { counter-increment: box; font-size: 3em; content: counter(box); } .box { display: flex; justify-content: center; align-content: center; align-items: center; }
相关文章
- ON1 Portrait AI 2023 for Mac(照片肖像美容软件)激活版
- Omni Toolbox for mac(全方位工具集合)
- ORA-23624: A comparison operation is currently in progress for string. ORACLE 报错 故障修复 远程处理
- ORA-24274: no row exists in the string table for these parameters ORACLE 报错 故障修复 远程处理
- ORA-26881: ORA-string: string raised in string automatic string job:”string”.”string” for Capture process “string” and cloned Capture process “string”. ORACLE 报错 故障修复 远程处理
- ORA-31604: invalid string parameter “string” for object type string in function string ORACLE 报错 故障修复 远程处理
- ORA-31600: invalid input value string for parameter string in function string ORACLE 报错 故障修复 远程处理
- ORA-41630: invalid value for “string” attribute in the rule class properties ORACLE 报错 故障修复 远程处理
- MySQL Error number: 4065; Symbol: ER_CHANGE_REPLICATION_SOURCE_NO_OPTIONS_FOR_GTID_ONLY; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-010859; Symbol: ER_BINLOG_CANT_CLEAR_IN_USE_FLAG_FOR_CRASHED_BINLOG; SQLSTATE: HY000 报错 故障修复 远程处理
- ORA-02786: Size needed for shared region is greater than segment size ORACLE 报错 故障修复 远程处理
- ORA-12853: insufficient memory for PX buffers: current stringK, max needed stringK ORACLE 报错 故障修复 远程处理
- ORA-13387: sdo_batch_size for array inserts should be in the range [number,number] ORACLE 报错 故障修复 远程处理
- ORA-13400: duplicate entry for string in USER_SDO_GEOR_SYSDATA view ORACLE 报错 故障修复 远程处理
- ORA-14645: STORE IN clause cannot be specified for Range List objects ORACLE 报错 故障修复 远程处理
- 查询解锁Oracle多条件In查询的机密(oracle多条件in)
- How to Use MySQL for Subtraction in Simple Steps.(mysql做减法)
- Oracle的IN走索引技术(in走索引 oracle)
- 研究Oracle IN语句的技巧与窍门(oracle in的语句)