hexo-theme-stellar/source/css/_defines/func.styl

125 lines
3.4 KiB
Stylus
Raw Normal View History

2021-02-19 23:33:19 +08:00
2021-04-22 23:37:14 +08:00
// // transition 使
// transition($op = all, $time = 0.28s, $ease = ease-out)
// transition: $op $time $ease
// -moz-transition: $op $time $ease
// -webkit-transition: $op $time $ease
// -o-transition: $op $time $ease
2021-03-05 21:37:28 +08:00
// 1
trans1($op, $time = 0.2s)
transition: $op $time ease-out
-moz-transition: $op $time ease-out
-webkit-transition: $op $time ease-out
-o-transition: $op $time ease-out
// 2
trans2($op1, $op2)
transition: $op1 0.2s ease-out, $op2 0.2s ease-out
-moz-transition: $op1 0.2s ease-out, $op2 0.2s ease-out
-webkit-transition: $op1 0.2s ease-out, $op2 0.2s ease-out
-o-transition: $op1 0.2s ease-out, $op2 0.2s ease-out
trans2pro($op1, $t1, $op2, $t2)
transition: $op1 $t1 ease-out, $op2 $t2 ease-out
-moz-transition: $op1 $t1 ease-out, $op2 $t2 ease-out
-webkit-transition: $op1 $t1 ease-out, $op2 $t2 ease-out
-o-transition: $op1 $t1 ease-out, $op2 $t2 ease-out
trans3($op1, $op2, $op3)
transition: $op1 0.2s ease-out, $op2 0.2s ease-out, $op3 0.2s ease-out
-moz-transition: $op1 0.2s ease-out, $op2 0.2s ease-out, $op3 0.2s ease-out
-webkit-transition: $op1 0.2s ease-out, $op2 0.2s ease-out, $op3 0.2s ease-out
-o-transition: $op1 0.2s ease-out, $op2 0.2s ease-out, $op3 0.2s ease-out
2021-07-14 01:18:25 +08:00
trans4($op1, $op2, $op3, $op4)
transition: $op1 0.2s ease-out, $op2 0.2s ease-out, $op3 0.2s ease-out, $op4 0.2s ease-out
-moz-transition: $op1 0.2s ease-out, $op2 0.2s ease-out, $op3 0.2s ease-out, $op4 0.2s ease-out
-webkit-transition: $op1 0.2s ease-out, $op2 0.2s ease-out, $op3 0.2s ease-out, $op4 0.2s ease-out
-o-transition: $op1 0.2s ease-out, $op2 0.2s ease-out, $op3 0.2s ease-out, $op4 0.2s ease-out
2021-03-05 21:37:28 +08:00
txt-ellipsis()
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
placeholder(rules)
&::-webkit-input-placeholder
rules()
&:-moz-placeholder
rules()
&::-moz-placeholder
rules()
&:-ms-input-placeholder
rules()
disable-select()
-moz-user-select: none
-ms-user-select: none
-webkit-user-select: none
user-select: none
2021-02-19 23:33:19 +08:00
scrollbar($w = 4px, $b = 2px, $c = var(--text-meta), $h = var(--text-p3))
&::-webkit-scrollbar
height: $w
width: $w
&::-webkit-scrollbar-track-piece
background: transparent
&::-webkit-scrollbar-thumb
background: $c
cursor: pointer
border-radius: $b
&:hover
background: $h
2021-07-14 00:15:21 +08:00
scrollbar-codeblock($height = 4px)
2021-02-19 23:33:19 +08:00
&::-webkit-scrollbar
2021-07-14 00:15:21 +08:00
height: $height
width: $height
2021-02-19 23:33:19 +08:00
&::-webkit-scrollbar-track-piece
background: transparent
&::-webkit-scrollbar-thumb
background: transparent
cursor: pointer
2022-12-15 22:42:48 +08:00
border-radius: $border-bar
2021-02-19 23:33:19 +08:00
&:hover
&::-webkit-scrollbar-thumb
background: var(--text-meta)
&:hover
background: var(--text-p3)
hover-block($v, $h, $br = 4px)
border-radius: $br
padding: $v $h
trans2 color background
&:hover
2021-03-08 17:54:23 +08:00
background: var(--block-hover)
2024-01-03 13:28:04 +08:00
floatable-trans()
trans2 transform box-shadow
floatable-float()
box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.15)
transform: translate3d(0, -2px, 0)
2024-02-04 18:27:30 +08:00
hoverable-card()
trans1 all
2024-02-07 16:21:19 +08:00
onlight()
2024-02-04 18:27:30 +08:00
box-shadow: $boxshadow-card
&:hover
floatable-float()
2024-02-07 16:21:19 +08:00
ondark()
&:hover
box-shadow: 0 0 4px -2px $color-theme, 0 0 24px -8px $color-theme
if theme(light)
onlight()
else if theme(dark)
ondark()
else
@media (prefers-color-scheme: light)
onlight()
@media (prefers-color-scheme: dark)
ondark()