// 聊天页面公共 mixins // 响应式 @mixin respond-to($breakpoint) { @if $breakpoint == tablet { @media (max-width: 768px) { @content; } } @else if $breakpoint == mobile { @media (max-width: 480px) { @content; } } } // 弹性布局 @mixin flex-center { display: flex; align-items: center; justify-content: center; } @mixin flex-between { display: flex; align-items: center; justify-content: space-between; } @mixin flex-column { display: flex; flex-direction: column; } // 文本省略 @mixin text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } // 多行文本省略 @mixin text-ellipsis-multi($lines: 2) { display: -webkit-box; -webkit-line-clamp: $lines; -webkit-box-orient: vertical; overflow: hidden; } // 滚动按钮样式 @mixin scroll-btn { position: absolute; top: 50%; transform: translateY(-50%); @include flex-center; width: 22px; height: 22px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.08); color: rgba(0, 0, 0, 0.4); background-color: #fff; font-size: 10px; cursor: pointer; z-index: 10; transition: all 0.2s ease; &:hover { background-color: #f3f4f6; border-color: rgba(0, 0, 0, 0.15); color: rgba(0, 0, 0, 0.6); } } // 操作按钮样式 @mixin action-btn { width: 24px; height: 24px; padding: 0; font-size: 13px; color: #555; background: transparent; border: none; border-radius: 4px; transition: all 0.2s ease; &:hover { color: #409eff; background: #f0f7ff; } &:active { background: #e6f2ff; } &[disabled] { color: #bbb; background: transparent; } .el-icon { font-size: 13px; } }