Skip to content

Commit

Permalink
Fix css vars in body (fix #3934)
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed Feb 4, 2023
1 parent 03d0a11 commit ed8d16b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion registry/lib/components/style/sidebar-offset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const component = defineComponentMetadata({
addComponentListener(
`${metadata.name}.offset`,
(value: number) => {
document.body.style.setProperty('--be-sidebar-offset', `${value}%`)
document.documentElement.style.setProperty('--be-sidebar-offset', `${value}%`)
},
true,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.be-settings > .sidebar {
top: calc(50% + var(--be-sidebar-offset)) !important;
top: calc(50% + var(--be-sidebar-offset, 0)) !important;
}
2 changes: 1 addition & 1 deletion registry/lib/components/video/player/show-cover/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const entry = async () => {
const { VideoInfo } = await import('@/components/video/video-info')
const info = new VideoInfo(aid)
await info.fetchInfo()
document.body.style.setProperty('--cover-url', `url('${info.coverUrl}')`)
document.documentElement.style.setProperty('--cover-url', `url('${info.coverUrl}')`)
}
videoChange(showCover)
}
Expand Down

0 comments on commit ed8d16b

Please sign in to comment.