hexo-theme-keep/source/css/common/basic.styl

310 lines
6.0 KiB
Stylus
Raw Normal View History

@import 'variables.styl'
@import 'animated.styl'
@import 'keep-theme.styl'
// ======================================================================
// all
// ======================================================================
* {
// ====================================
// transition
// ====================================
transition-g()
// ====================================
// scrollbar
// ====================================
&::-webkit-scrollbar {
width 0.4rem
height 0.4rem
transition all 0.2s ease
}
&::-webkit-scrollbar-thumb {
background var(--scrollbar-color)
border-radius 0.1rem
}
&::-webkit-scrollbar-track {
2022-10-14 17:56:32 +08:00
background var(--scrollbar-background-color)
}
}
2020-09-03 12:28:24 +08:00
2021-01-07 15:15:39 +08:00
// ======================================================================
2020-09-03 12:28:24 +08:00
// html, body
2021-01-07 15:15:39 +08:00
// ======================================================================
html
body {
position relative
width 100%
height 100%
margin 0
padding 0
2022-10-14 17:56:32 +08:00
color var(--text-color-3)
font-weight $default-font-weight
font-size $default-font-size
font-family $default-font-family
line-height $default-font-line-height
letter-spacing 0.2px
2022-10-14 17:56:32 +08:00
background var(--background-color-1)
2020-09-03 12:28:24 +08:00
2021-01-08 16:07:54 +08:00
&::-webkit-scrollbar {
width 0.6rem
height 0.6rem
2021-01-08 16:07:54 +08:00
}
+keep-tablet() {
&::-webkit-scrollbar {
width 0.5rem
height 0.5rem
}
}
+keep-mobile() {
&::-webkit-scrollbar {
width 0.4rem
height 0.4rem
}
}
2020-11-20 12:02:22 +08:00
+keep-tablet() {
font-size $default-font-size * 0.96
line-height $default-font-line-height * 0.96
2020-09-03 12:28:24 +08:00
}
2020-11-20 12:02:22 +08:00
+keep-mobile() {
font-size $default-font-size * 0.9
line-height $default-font-line-height * 0.9
2020-09-03 12:28:24 +08:00
}
}
2020-09-01 19:21:28 +08:00
2021-01-07 15:15:39 +08:00
// ======================================================================
2020-09-03 12:28:24 +08:00
// selection
2021-01-07 15:15:39 +08:00
// ======================================================================
::selection {
color #fff
background var(--selection-color)
}
2020-09-01 19:21:28 +08:00
2021-01-07 15:15:39 +08:00
// ======================================================================
2020-09-03 12:28:24 +08:00
// ul, ol, li
2021-01-07 15:15:39 +08:00
// ======================================================================
ul
ol
li {
margin 0
padding 0
list-style none
}
2020-12-01 16:51:38 +08:00
2021-01-07 15:15:39 +08:00
// ======================================================================
2020-09-03 12:28:24 +08:00
// a
2021-01-07 15:15:39 +08:00
// ======================================================================
a {
2022-10-14 17:56:32 +08:00
color var(--text-color-3)
text-decoration none
i
span {
2022-10-14 17:56:32 +08:00
color var(--text-color-3)
}
&:hover
&:active {
color var(--primary-color)
text-decoration none !important
i
span {
color var(--primary-color)
}
2020-09-03 12:28:24 +08:00
}
}
2020-12-01 16:51:38 +08:00
2021-01-07 15:15:39 +08:00
// ======================================================================
// img
// ======================================================================
img {
&[lazyload] {
2022-10-04 23:52:46 +08:00
position relative
box-sizing border-box
width 8rem
height 8rem
box-shadow none !important
cursor not-allowed
pointer-events none
2022-10-04 23:52:46 +08:00
&::before {
position absolute
top 0
left 0
display block
width 100%
height 100%
2022-10-14 17:56:32 +08:00
background var(--background-color-1)
2022-10-04 23:52:46 +08:00
content ''
transition-t("background", "0", "0.2", "ease")
}
&::after {
position absolute
top 0
right 0
bottom 0
left 0
display block
width 2rem
height 2rem
margin auto
2022-10-14 17:56:32 +08:00
border 2px solid var(--text-color-6)
2022-10-04 23:52:46 +08:00
border-top-color var(--selection-color)
border-left-color var(--selection-color)
border-radius 50%
animation img-loading-animation 750ms infinite linear
content ''
transition-t("border", "0", "0.2", "ease")
}
2021-01-07 15:15:39 +08:00
}
}
// ======================================================================
2020-09-03 12:28:24 +08:00
// button
2021-01-07 15:15:39 +08:00
// ======================================================================
button {
margin 0
padding 0
background transparent
border 0
outline none
cursor pointer
}
.btn {
position relative
display inline-block
padding 0.4rem 1rem
white-space nowrap
text-align center
2022-10-14 17:56:32 +08:00
background var(--background-color-1)
border-radius 5px
cursor pointer
hover-style(true, 1.06, 1.06)
&:hover {
2022-10-14 17:56:32 +08:00
color var(--background-color-1)
background var(--primary-color)
}
2020-09-01 19:21:28 +08:00
}
2020-11-19 11:58:54 +08:00
2021-01-07 15:15:39 +08:00
// ======================================================================
2020-11-19 11:58:54 +08:00
// flex center
2021-01-07 15:15:39 +08:00
// ======================================================================
2020-11-19 11:58:54 +08:00
.flex-center {
display flex
align-items center
justify-content center
2020-11-19 11:58:54 +08:00
}
2020-12-01 16:51:38 +08:00
2021-01-07 15:15:39 +08:00
// ======================================================================
// clear float
2021-01-07 15:15:39 +08:00
// ======================================================================
.clear {
&::after {
display block
clear both
height 0
overflow hidden
visibility hidden
content ''
}
}
// ======================================================================
// tooltip
// ======================================================================
.tooltip {
position relative
box-sizing border-box
&:hover {
.tooltip-content {
display inline-block
}
}
&.show-img {
.tooltip-content {
display none !important
}
}
.tooltip-content {
position absolute
top -0.4rem
left 50%
z-index $z-index-9
display none
box-sizing border-box
padding 0.2rem 0.6rem
2022-10-14 17:56:32 +08:00
color var(--text-color-6)
font-size 0.8rem
letter-spacing 0.8px
white-space nowrap
2022-10-14 17:56:32 +08:00
background var(--text-color-1)
border-radius 0.3rem
transform translateX(-50%) translateY(-100%)
transition-t("display", "0", "0.2", "ease")
disable-user-select()
}
}
.tooltip-img {
position relative
box-sizing border-box
&.show-img {
.tooltip-img-box {
display flex
}
}
.tooltip-img-box {
position absolute
top -0.4rem
left 50%
z-index $z-index-8
display none
align-items center
justify-content center
box-sizing border-box
min-height 6rem
2022-10-14 17:56:32 +08:00
background var(--text-color-6)
border 0.2rem solid var(--text-color-3)
border-radius 0.3rem
transform translateX(-50%) translateY(-100%)
transition-t("display", "0", "0.2", "ease")
disable-user-select()
img {
display block
max-height 10rem
}
}
}