Skip to content

Commit

Permalink
fix(titlebar): style for overlay mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alex8088 committed Aug 11, 2024
1 parent 89d7e53 commit 5ce8780
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/titlebar/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ const SHADOW_ROOT_CSS = `
}
`

const OVERLAY_HOST_CSS = `
:host {
position: absolute;
right: 0;
top: 0;
z-index: 10000;
}
`

export default class TitleBar extends HTMLElement {
constructor() {
super()
Expand All @@ -156,14 +165,14 @@ export default class TitleBar extends HTMLElement {
connectedCallback(): void {
const shadow = this.attachShadow({ mode: 'open' })

const overlay = this.hasAttribute('overlay')

const style = document.createElement('style')
style.textContent = SHADOW_ROOT_CSS
style.textContent = SHADOW_ROOT_CSS + (overlay ? OVERLAY_HOST_CSS : '')
shadow.appendChild(style)

const isMacintosh = core.process.platform === 'darwin'

const overlay = this.hasAttribute('overlay')

if (!overlay) {
const el = document.createElement('div')
el.classList.add('titlebar__drag-region')
Expand Down

0 comments on commit 5ce8780

Please sign in to comment.