Skip to content

Commit

Permalink
style: finetuning titlebar look-n-feel for PWA support
Browse files Browse the repository at this point in the history
The previous patch (675e59c) introduce initial PWA WCO support,
this patch finetunes the PWA titlebar support by ensure the bottom
border of the titlebar is always visible and fill 100% page (window)
width, with the following changes:

1. Use margin instead of padding to ensure 'width' fills 100% page
   width, so does bottom border.
2. Add extra 1px height to ensure the bottom border won't be covered
   by the window decoration overlay itself.

Remaining PWA stuff:

The remaining PWA WCO part have inconsistent color with the actual
color that SiYuan('s titlebar) uses, thus to make the PWA titlebar
feel native, we still needs to set either:

- a "theme-color" `<meta>` attribute (suggested)
- a "theme_color" member in the PWA manifest

...which will be a seprated topic that won't be worked on in this
patchset.
  • Loading branch information
BLumia committed Jan 10, 2025
1 parent 8cce186 commit 6283420
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/src/assets/scss/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ html {
border-bottom: .5px solid var(--b3-border-color);

&--browser {
padding-left: 0;
margin-left: env(titlebar-area-x, 0);
width: env(titlebar-area-width, 100%);
height: env(titlebar-area-height, 32px);
padding-left: env(titlebar-area-x, 0);
padding-right: calc(100% - env(titlebar-area-width, 100%) - env(titlebar-area-x, 0));
height: calc(env(titlebar-area-height, 32px) + 1px);
}

#windowControls {
Expand Down

0 comments on commit 6283420

Please sign in to comment.