Skip to content

Commit ccb6866

Browse files
committed
fix(live-preview): toolbar buttons occluded by centre section with long filenames
Replace fixed-width percentage layout with flex-based sizing so left and right toolbar buttons are always visible and the centre filename truncates with ellipsis. Move inline styles to live-preview.css.
1 parent da5d88c commit ccb6866

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

src-node/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extensionsIntegrated/Phoenix-live-preview/live-preview.css

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,13 @@
375375
color: rgba(100, 180, 255, 0.8);
376376
}
377377

378+
#live-preview-plugin-toolbar {
379+
display: flex;
380+
align-items: center;
381+
flex-direction: row;
382+
}
383+
378384
.lp-toolbar-left {
379-
width: 20%;
380385
display: flex;
381386
align-items: center;
382387
gap: 6px;
@@ -385,6 +390,22 @@
385390
flex-shrink: 0;
386391
}
387392

393+
.lp-toolbar-centre {
394+
flex: 1;
395+
min-width: 0;
396+
display: flex;
397+
justify-content: center;
398+
align-items: center;
399+
overflow: hidden;
400+
}
401+
402+
.lp-toolbar-right {
403+
display: flex;
404+
align-items: center;
405+
justify-content: flex-end;
406+
flex-shrink: 0;
407+
}
408+
388409
#reloadLivePreviewButton,
389410
#designModeToggleLivePreviewButton {
390411
width: 28px;

src/extensionsIntegrated/Phoenix-live-preview/panel.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="panel-live-preview">
2-
<div id="live-preview-plugin-toolbar" class="plugin-toolbar" style="display: flex; align-items: center; flex-direction: row;">
2+
<div id="live-preview-plugin-toolbar" class="plugin-toolbar">
33
<div class="lp-toolbar-left">
44
<button id="reloadLivePreviewButton" title="{{clickToReload}}" class="btn-alt-quiet toolbar-button">
55
<i class="fa-solid fa-arrow-rotate-right"></i>
@@ -16,7 +16,7 @@
1616
</button>
1717
</span>
1818
</div>
19-
<div style="width: fit-content;min-width: 60%;display: flex;justify-content: center; align-items: center;">
19+
<div class="lp-toolbar-centre">
2020
<!-- these are buttons that are always invisible to help central align the panel title-->
2121
<button id="safariButtonBallast" title="{{openInSafari}}" class="btn-alt-quiet toolbar-button live-preview-browser-btn forced-hidden">
2222
<img src="thirdparty/devicon/icons/safari/safari-original.svg" />
@@ -47,7 +47,7 @@
4747
<img src="thirdparty/devicon/icons/firefox/firefox-original.svg" />
4848
</button>
4949
</div>
50-
<div style="width: 20%;display: flex;align-items: center; justify-content: flex-end">
50+
<div class="lp-toolbar-right">
5151
<button id="livePreviewSettingsBtn" title="{{livePreviewSettings}}"
5252
class="btn-alt-quiet toolbar-button lp-settings-icon"><i class="fa-solid fa-gear"></i></button>
5353
</div>

0 commit comments

Comments
 (0)