Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(floatbar): [floatbar] Adapt to dark themes #3045

Merged
merged 6 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import { TinyFloatbar } from '@opentiny/vue'
.custom {
position: static;
width: 120px;
background-color: #dbdbdb;
background-color: gray;
}
.custom li:hover {
background: #fff;
background: darkgray;
}
</style>
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/floatbar/custom-style.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ test('自定义样式', async ({ page }) => {
const floatbar = page.locator('.tiny-float-bar')
const item = page.getByRole('listitem').filter({ hasText: '本地引入' })
await expect(floatbar).toHaveClass(/custom/)
await expect(floatbar).toHaveCSS('background-color', 'rgb(219, 219, 219)')
await expect(floatbar).toHaveCSS('background-color', 'rgb(128, 128, 128)')
await item.hover()
await expect(item).toHaveCSS('background-color', 'rgb(255, 255, 255)')
await expect(item).toHaveCSS('background-color', 'rgb(169, 169, 169)')
await expect(item.locator('a')).toHaveCSS('color', 'rgb(25, 25, 25)')
})
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/floatbar/custom-style.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default {
.custom {
position: static;
width: 120px;
background-color: #dbdbdb;
background-color: gray;
}
.custom li:hover {
background: #fff;
background: darkgray;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const colStyle = ({ viewRow, viewCol }) => {
display: table-cell;
font-size: 12px;
background-color: var(--docs-color-bg);
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 1px 100%);
background-image:
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 1px 100%);
background-position:
0 0,
0 1px;
Expand All @@ -111,8 +111,9 @@ const colStyle = ({ viewRow, viewCol }) => {
}

.vs-is-last-row > .vs-cell {
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%);
background-image:
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%);
background-position:
0 0,
0 1px,
Expand All @@ -125,8 +126,9 @@ const colStyle = ({ viewRow, viewCol }) => {
}

.vs-is-last-col.vs-cell {
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%);
background-image:
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%);
background-position:
0 0,
0 1px,
Expand All @@ -139,9 +141,9 @@ const colStyle = ({ viewRow, viewCol }) => {
}

.vs-is-last-row > .vs-is-last-col.vs-cell {
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%);
background-image:
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%);
background-position:
0 0,
0 1px,
Expand Down
20 changes: 11 additions & 9 deletions examples/sites/demos/pc/app/virtual-scroll-box/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ export default {
display: table-cell;
font-size: 12px;
background-color: var(--docs-color-bg);
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 1px 100%);
background-image:
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 1px 100%);
background-position:
0 0,
0 1px;
Expand All @@ -121,8 +121,9 @@ export default {
}

.vs-is-last-row > .vs-cell {
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%);
background-image:
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%);
background-position:
0 0,
0 1px,
Expand All @@ -135,8 +136,9 @@ export default {
}

.vs-is-last-col.vs-cell {
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%);
background-image:
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%);
background-position:
0 0,
0 1px,
Expand All @@ -149,9 +151,9 @@ export default {
}

.vs-is-last-row > .vs-is-last-col.vs-cell {
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%);
background-image:
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%),
linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 100%);
background-position:
0 0,
0 1px,
Expand Down
2 changes: 1 addition & 1 deletion packages/design/saas/src/milestone/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
if (statusColor) {
return {
background: props.solid ? statusColor : '',
color: props.solid && !isCompleted ? '#ffffff' : statusColor,
color: props.solid && !isCompleted ? '#ffffff' : statusColor,
'border-color': statusColor
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/src/floatbar/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
padding: 0 24px;

&:hover {
background: var(--tv-Floatbar-list-bg-color)
background: var(--tv-Floatbar-list-bg-color-hover)
}

a {
Expand All @@ -53,7 +53,7 @@

&:hover,
&:focus {
color: var(--tv-Floatbar-list-hover-text-color);
color: var(--tv-Floatbar-list-text-color-hover);
text-decoration: none;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/src/floatbar/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
// 浮动块背景色
--tv-Floatbar-bg-color: var(--tv-color-bg-2);
// 选项悬浮背景色
--tv-Floatbar-list-bg-color: var(--tv-color-bg-hover);
--tv-Floatbar-list-bg-color-hover: var(--tv-color-bg-hover);
// ul,li边距
--tv-Floatbar-list-margin-x: var(--tv-space-md);
// 列表项文本色
--tv-Floatbar-list-text-color: var(--tv-color-text);
// 列表项悬浮文本色
--tv-Floatbar-list-hover-text-color: var(--tv-color-text);
--tv-Floatbar-list-text-color-hover: var(--tv-color-text-hover);
}