Appearance
元素样式
子元素居中
json
"display": "flex",
"justifyContent": "center",
"alignItems": "center",
json
"position": "absolute",
"top": "50%",
"left": "50%",
"transform": "translate(-50%, -50%)",
过渡动画设置时长
json
"transition": "200ms",
元素平移、旋转、缩放
json
"transform": "translate(12px, 12px) rotate(90deg) scale(0.8)",
渐变色
json
"background": "linear-gradient(to right, rgb(10, 183, 114), rgb(33, 203, 219))"
鼠标悬浮时改变样式
css
.xxx:hover{
background: #409eff;
color: #fff;
}
阴影
json
"boxShadow": "0 0 10px #ccc"
三元判断
json
"background": "v: A ? '1' : '2'"
json
"background": "v: (A && B) ? '1' : '2'"
json
"background": "v: A ? '1' : (B ? '2' : '3')"