fix(admin/settings): 修复标签栏溢出时背景色未覆盖「数据备份」#2263
Open
zhoupb01 wants to merge 1 commit intoWei-Shaw:mainfrom
Open
fix(admin/settings): 修复标签栏溢出时背景色未覆盖「数据备份」#2263zhoupb01 wants to merge 1 commit intoWei-Shaw:mainfrom
zhoupb01 wants to merge 1 commit intoWei-Shaw:mainfrom
Conversation
新增「登录条款」标签后,settings-tabs 共有 9 个标签,在中等宽度的视窗 下子项会横向溢出。媒体查询将容器从 inline-flex 改成 flex,使容器宽度 固定在父级 100%,溢出部分(如「数据备份」)落在背景色之外,看上去 像是丢了底色。 主样式本身就是 inline-flex min-w-full,溢出时容器会自然撑开,背景能 正常覆盖到所有子项。删除冗余的媒体查询即可修复,能塞下时视觉与之前 完全一致。
Contributor
|
All contributors have signed the CLA. ✅ |
Contributor
There was a problem hiding this comment.
Pull request overview
此 PR 修复 /admin/settings 页面设置标签栏在中等宽度视窗下发生横向溢出时,最后一个标签(「数据备份」)落在胶囊背景(bg-white/80)之外的问题;通过让标签容器在内容溢出时可随内容扩展,从而确保背景覆盖全部标签并与横向滚动一致。
Changes:
- 移除
.settings-tabs在min-width: 640px时强制变为flex(block 级宽度锁定为 100%)的媒体查询覆盖 - 统一使用
inline-flex min-w-full:内容不溢出时仍铺满容器,溢出时容器随内容增长以覆盖背景
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
/admin/settings页面 settings-tabs 标签栏中,最后一个标签「数据备份」缺失背景色——bg-white/80的圆角胶囊背景在它身上断掉了。复现
/admin/settings根因
frontend/src/views/admin/SettingsView.vue中样式定义如下:主规则是
inline-flex min-w-full,但 ≥640px 时被覆盖成flex。两者关键差别:inline-flex:inline 级别,宽度跟随内容;min-width: 100%保证至少撑满父容器,内容更宽时容器一起撑大。flex:block 级别,宽度默认等于父容器(即 100%),不会随内容增长。#e872cba(feat: 添加登录注册条款确认)新增agreement后,标签数量从 8 变为 9。在中等宽度视窗下,9 个whitespace-nowrap+flex-1的标签 min-content 总和会超过容器 100% 宽度——但因为媒体查询把容器锁在flex(block 级),容器宽度仍是 100%,子项溢出到容器外。bg-white/80只画在容器实际宽度内,溢出部分(最后的「数据备份」)落在背景色之外。父级
.settings-tabs-scroll是overflow-x-auto,所以溢出可滚动看到,但底色丢失的问题就此暴露。修复
删除 ≥640px 的媒体查询。主规则
inline-flex min-w-full已经能正确处理两种情形:min-width: 100%让容器至少 100% 宽,子项flex-1平均分配 — 与之前视觉完全一致。inline-flex让容器随内容撑大,背景覆盖到所有子项 — 修好。影响面
.settings-tabsclass 仅在SettingsView.vue使用一处(<nav class="settings-tabs">),样式定义也只在本文件,无其他引用。<nav>,没有 inline 兄弟元素,inline-flex不会引入空白或基线问题。测试