
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
使用unocss重新实现大部分规则,以减少dist。
unocss: https://github.com/unocss/unocss
增加unocss的规则,以及对官方extractorPug问题的修复,解决在某些情况下无法读取pug class规则的问题。
vite项目中使用
import Unocss from 'unocss/vite'
import {extractorSplit, presetUno} from 'unocss'
import {rules, extractorPugFactory} from "luss/dist/unocss-luss"
/*
该语句可能在ts中被标红
需要再tsconfig.node.json增加如下配置
compilerOptions.lib: ["es2015"]
*/
const extractorPug = extractorPugFactory(import("pug"))
export default {
plugins: [
Unocss(
{
//@ts-ignore
rules: [
//@ts-ignore
...rules
],
extractors: [
extractorPug(),
extractorSplit
],
"presets": [
// 否则颜色相关的设定会报错
presetUno(),
]
}
)
]
}
ease部分的内容来自qivhou的仓库 https://github.com/qivhou/easing.less
以及raphaelameaume的 https://github.com/raphaelameaume/gsap-easings-css
#文档
.m10 //margin:10em
mt01 //margin-top:0.1em
mt01x //margin-top:0.1px
.t15xi //top:15px !important
.-l10-2vh //left: -10.2vh
.cl-red100 //color: #ff0000
.bg-red;
.bc-red;
.ho_cl-red; //.ho_cl-red:hover{color:@red}
.son_cl-red; //.son_cl-red>*{color:@red}
.son-ho_cl-red; //.son_cl-red>*:hover{color:@red}
.maxh150x
.minw180x
工具类大致分为m,p,size,color系列以及其他零散的小工具class
###p系列用来设置目标元素盒模型的padding
.p10工具类对应的规则为
.p10{padding:1em}
/*支持import*/
.p10-i{padding:1em !important}
| 规则名称 | 规则内容 | 说明 | 举例 |
|---|---|---|---|
| p* | padding | - | <div class="pl10"> |
| pl* | padding-left | - | |
| pt* | padding-top | ||
| pr* | padding-right | ||
| pb* | padding-bottom | ||
| ph* | padding-left, padding-right | 设置水平方向padding | <div class="ph10"> |
| pv* | padding-top, padding-bottom | 设置垂直方向padding | - |
| 规则名称 | 规则内容 | 说明 | 举例 |
|---|---|---|---|
| m* | margin | - | <div class="pl10"> |
| ml* | margin-left | - | |
| mt* | margin-top | ||
| mr* | margin-right | ||
| mb* | margin-bottom | ||
| mh* | margin-left, margin-right | 设置水平方向margin | <div class="mh10"> |
| mv* | margin-top, margin-bottom | 设置垂直方向margin | - |
| m-auto | margin:auto | 设置padding为auto | |
| ml-auto | margin-left:auto | 设置左padding为auto | - |
| mt-auto | - | - | - |
| mr-auto | - | - | - |
| mb-auto | - | - | - |
数值同上
| 规则名称 | 规则内容 | 说明 | 举例 |
|---|---|---|---|
| w* | width | 设置目标width | - |
| h* | height | 设置目标height | - |
| fz* | font-size | - | - |
| lh* | height,line-height | - | - |
| ti* | text-indent | 设置block元素的首行缩进 | - |
数值通同上
| 规则 | 加重 | 说明 |
|---|---|---|
| h1px | h1px-i | |
| w1px | w1px-i | |
| bl1px | - | |
| bt1px | - | |
| brpx | - | |
| bb1px | - | |
| b1px | - | border-width:1px |
0 1 2 3 4 5
| 规则 | 加重 | 说明 |
|---|---|---|
| w00p | w00p-i | width:0%; |
| w15p | w15p-i | width:15% |
| w33d33 | w33d33-i | width:33.33% |
| ... | ... | ... |
| w100p | w100p-i | width:100% |
可用值
| 规则 | 加重 | 说明 |
|---|---|---|
| vw10 | vw10-i | width:10vw |
| vh10 | vh10-i | width:10vh |
可用值
| 规则 | 加重 | hover |
|---|---|---|
| op00 | op00-i | op00-hover |
| op00d5 | - | - |
| op01 | - | - |
| op01d5 | ||
| ... | ... | ... |
| op09d5 | - | - |
| op10 | op10-i | op10-hover |
可用值
| 规则 | 加重 | hover |
|---|---|---|
| scale00 | scale00-i | scale00-hover |
| scale00d5 | - | - |
| sacle01 | - | - |
| scale01d5 | ||
| ... | ... | ... |
| scale09d5 | - | - |
| scale10 | scale10-i | op10-hover |
可用值
| 规则 | 加重 | hover | hover加重 | 说明 |
|---|---|---|---|---|
| cl-red | cl-red-i | cl-red-hover | cl-red-hover | color:#f44336 |
| bg-red | cl-red-i | cl-red-hover | cl-red-hover | background-color:#f44336 |
| bd-red | cl-red-i | cl-red-hover | cl-red-hover | border-color:#f44336 |
颜色可用值请参考meterial design colors https://www.materialui.co/colors 首字母用小写
.flex
.flex.inline flex-inline
.flex.inline.fix 修复0.14em误差
.flex.column flex-direction:column;
.jc-start
.jc-center
.jc-end
.jc-between
.between 同上
.jc-around
.around 同上
.ai-start
.ai-center
.ai-end
.ai-stretch
.ac-start
.ac-center
.ac-end
.ac-between
.ac-around
.ac-stretch
.wrap
.wrap-rev
.wrap-no
.wrap-in
.wrap-un
.as-start
.as-center
.as-end
.as-stretch
.fx1
.fx2
.fx3
.fx4
.fx5
FAQs
A less tookit
We found that luss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.