Skip to content

Instantly share code, notes, and snippets.

@SummonHIM
Last active November 23, 2024 12:09
Show Gist options
  • Select an option

  • Save SummonHIM/030a2dab097104f9c721ee746fb5e826 to your computer and use it in GitHub Desktop.

Select an option

Save SummonHIM/030a2dab097104f9c721ee746fb5e826 to your computer and use it in GitHub Desktop.
/* ==UserStyle==
@name Yet Another Avatar Float
@description 头像相关的调整:头像浮动、头像边框和头像置底等
@preprocessor stylus
@version 0.4.0
@homepageURL https://gist.github.com/SummonHIM/030a2dab097104f9c721ee746fb5e826
@author PRO-2684 & SummonHIM
@license gpl-3.0
@var range topOffsetChat "头像聊天界面顶部偏移 (px)" [10, 0, 100, 1, "px"]
@var range btnOffsetChat "头像聊天界面底部偏移 (px)" [10, 0, 100, 1, "px"]
@var range topOffsetHistory "头像聊天记录顶部偏移 (px)" [46, 0, 100, 1, "px"]
@var range topOffsetCheckbox "多选框聊天界面顶部偏移 (px)" [18, 0, 100, 1, "px"]
@var range btnOffsetCheckbox "多选框聊天界面底部偏移 (px)" [18, 0, 100, 1, "px"]
@var text avatarOutline "头像边框" "1px solid var(--on_bg_text)"
@var select avatarAlign "头像置于" {
"start:顶部": "start",
"end:底部": "end"
}
==/UserStyle== */
#ml-root {
.ml-list {
overflow: unset;
}
.avatar-span {
position: sticky;
top: topOffsetChat;
bottom: btnOffsetChat;
align-self: avatarAlign;
margin-bottom: btnOffsetChat;
}
&.record-msg-panel .avatar-span {
top: topOffsetHistory;
}
.msg-picker.q-checkbox {
position: sticky;
top: topOffsetCheckbox;
bottom: btnOffsetCheckbox;
align-self: avatarAlign;
margin-bottom: btnOffsetCheckbox;
}
}
.avatar {
outline: avatarOutline;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment