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
titlebar is always visible and fill 100% page (window)
width, with the following changes:

* Use margin instead of padding to ensure 'width' fills 100% page
  width, so does bottom border.

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.

Also, the titlebar bottom border might be covered by the WCO, since
it involves half-pixel border issue which seems to be by-design,
I won't address such issue in this patchset.

See also:

* #13226 (comment)
  This patchset can address this issue
* #13779 (comment)
  Previously mentioned half-pixel issue
  • Loading branch information
BLumia committed Jan 23, 2025
1 parent 8cce186 commit 746289d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/assets/scss/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ 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%);
padding-left: env(titlebar-area-x, 0);
padding-right: calc(100% - env(titlebar-area-width, 100%) - env(titlebar-area-x, 0));
height: env(titlebar-area-height, 32px);
}

Expand Down

0 comments on commit 746289d

Please sign in to comment.