Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

Chrome CSS: physical directional properties become logical

nyblnet2b9d3cf747df
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.ts
index 4a90d5f4..a770cebd 100644
--- a/slides/src/editor/editor.ts
+++ b/slides/src/editor/editor.ts
@@ -995,9 +995,9 @@ export class Editor {
if (c.code === locale()) b.classList.add('ed-lang-on')
menu.appendChild(b)
}
- // right-anchor so the menu never overflows the window edge
- menu.style.left = 'auto'
- menu.style.right = '0'
+ // end-anchored so the menu never overflows the window edge — as a class,
+ // not inline left/right, so it follows the chrome's direction (.ed-lang-menu
+ // in styles.css, alongside the Save menu's identical rule)
wrap.append(trigger, menu)
document.addEventListener('pointerdown', (ev) => {
if (!wrap.contains(ev.target as Node)) wrap.classList.remove('open')
diff --git a/slides/src/styles.css b/slides/src/styles.css
index 755c9120..c1f7602a 100644
--- a/slides/src/styles.css
+++ b/slides/src/styles.css
@@ -116,7 +116,7 @@ option { background: #fff; color: #1e2a3a; }
/* unsaved-changes dot — badges the SAVE button's corner (amber when dirty) */
.ed-dirty {
position: absolute;
- top: 3px; right: 3px;
+ top: 3px; inset-inline-end: 3px;
width: 7px; height: 7px; border-radius: 50%;
background: transparent; pointer-events: none;
}
@@ -124,7 +124,7 @@ option { background: #fff; color: #1e2a3a; }
.ed-split > .ed-btn:first-child { position: relative; }
.ed-group { display: flex; align-items: center; gap: 6px; }
-.ed-group-right { margin-left: auto; }
+.ed-group-right { margin-inline-start: auto; }
.ed-btn {
display: inline-flex;
@@ -157,7 +157,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
display: none;
position: absolute;
top: calc(100% + 4px);
- left: 0;
+ inset-inline-start: 0;
flex-direction: column;
background: #fff;
border: 1px solid var(--line);
@@ -186,7 +186,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
align-items: center;
gap: 10px;
background: #fff;
- border-right: 1px solid var(--line);
+ border-inline-end: 1px solid var(--line);
}
.ed-thumb {
@@ -204,7 +204,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
.ed-thumb.drop { border-color: var(--blue); }
.ed-thumb-num {
position: absolute;
- top: 4px; left: 4px;
+ top: 4px; inset-inline-start: 4px;
z-index: 2;
font-size: 10px;
font-weight: 600;
@@ -215,7 +215,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
}
.ed-thumb-tools {
position: absolute;
- right: 4px; top: 4px;
+ inset-inline-end: 4px; top: 4px;
z-index: 2;
display: none;
gap: 2px;
@@ -293,10 +293,10 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
border-radius: 2px;
}
-/* zoom controls, bottom-right of the canvas */
+/* zoom controls, bottom-end corner of the canvas */
.ed-zoombar {
position: absolute;
- right: 14px;
+ inset-inline-end: 14px;
bottom: 14px;
display: flex;
align-items: center;
@@ -393,7 +393,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
flex: none;
overflow-y: auto;
background: #fff;
- border-left: 1px solid var(--line);
+ border-inline-start: 1px solid var(--line);
padding: 14px;
}
@@ -729,7 +729,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
background: var(--chrome-2, #f4f1ea); border: 1px solid var(--line, #e7e1d2);
border-radius: 5px; padding: 2px 6px; color: var(--ink, #1e2a3a); white-space: nowrap; justify-self: start;
}
-.ed-help-tips { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--ink, #26303e); }
+.ed-help-tips { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.5; color: var(--ink, #26303e); }
.ed-help-tips li { margin: 3px 0; }
.ed-help-more { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line, rgba(30,42,58,0.12)); text-align: center; }
.ed-help-more a { color: var(--accent, #ED8266); font-weight: 600; font-size: 13px; text-decoration: none; }
@@ -791,7 +791,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
grid-template-columns: 1fr auto auto;
align-items: center;
gap: 10px;
- text-align: left;
+ text-align: start;
padding: 9px 12px;
border: 1px solid var(--line, #e7e1d2);
border-radius: 8px;
@@ -853,7 +853,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
text-transform: uppercase;
letter-spacing: 0.04em;
color: #7a8494;
- text-align: left;
+ text-align: start;
padding: 2px 4px;
white-space: nowrap;
}
@@ -924,11 +924,11 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
.ed-btn-armed:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); }
/* collapsible panel sections */
-.ed-sec-toggle { cursor: pointer; user-select: none; position: relative; padding-left: 14px; }
+.ed-sec-toggle { cursor: pointer; user-select: none; position: relative; padding-inline-start: 14px; }
.ed-sec-toggle::before {
content: '';
position: absolute;
- left: 1px;
+ inset-inline-start: 1px;
top: 50%;
width: 0; height: 0;
border-left: 5px solid currentColor;
@@ -1059,7 +1059,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
}
.ed-comment-entries { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.ed-comment-entry b { font-size: 12.5px; }
-.ed-comment-entry .ed-comment-time { font-size: 11px; color: var(--muted); margin-left: 5px; }
+.ed-comment-entry .ed-comment-time { font-size: 11px; color: var(--muted); margin-inline-start: 5px; }
.ed-comment-entry p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.ed-comment-reply {
width: 100%;
@@ -1077,7 +1077,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
.ed-thumb-cmt {
position: absolute;
bottom: 5px;
- right: 5px;
+ inset-inline-end: 5px;
z-index: 2;
width: 9px;
height: 9px;
@@ -1140,7 +1140,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
.ed-layoutpick-del {
position: absolute;
top: -7px;
- right: -7px;
+ inset-inline-end: -7px;
width: 18px;
height: 18px;
border: none;
@@ -1298,7 +1298,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
.sv-timer:hover { color: #f7a600; }
.sv-clock { font-size: 15px; color: #9fb0c3; }
.sv-count { font-size: 15px; color: #9fb0c3; font-variant-numeric: tabular-nums; }
-.sv-ctrls { margin-left: auto; display: flex; align-items: center; gap: 6px; }
+.sv-ctrls { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.sv-btn {
width: 34px;
height: 30px;
@@ -1380,7 +1380,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
.sv-thumb .sv-frame { box-shadow: none; border-radius: 0; }
.sv-thumb-n {
position: absolute;
- left: 4px;
+ inset-inline-start: 4px;
bottom: 4px;
min-width: 16px;
padding: 1px 5px;
@@ -1443,7 +1443,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
.ed-avatars {
display: flex;
align-items: center;
- margin: 0 6px 0 2px;
+ margin-inline: 2px 6px;
flex-shrink: 0;
}
.ed-avatar {
@@ -1460,10 +1460,10 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
padding: 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
/* overlap into a coin-stack so N avatars stay bounded in width */
- margin-left: -7px;
+ margin-inline-start: -7px;
}
.ed-avatars .ed-avatar:first-child {
- margin-left: 0;
+ margin-inline-start: 0;
}
.ed-avatar:hover {
transform: translateY(-1px);
@@ -1509,8 +1509,8 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
max-width: 290px;
padding: 12px;
gap: 7px;
- right: 0;
- left: auto;
+ inset-inline-end: 0;
+ inset-inline-start: auto;
}
.ed-share-label {
font-size: 10.5px;
@@ -1545,7 +1545,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
border: 1px solid var(--line);
}
.ed-share-btn:not(.ed-btn-primary):hover { background: var(--chrome-2, #e8ebf1); }
-.ed-share-btn { width: 100%; justify-content: flex-start; text-align: left; }
+.ed-share-btn { width: 100%; justify-content: flex-start; text-align: start; }
.ed-share-btn svg { flex: none; }
/* divider usable in any dropdown menu */
@@ -1557,9 +1557,12 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
NESTED inside the .ed-dropdown wrapper, so stretch through the wrapper. */
.ed-split { display: inline-flex; align-items: stretch; }
.ed-split > .ed-btn:first-child {
- border-radius: 8px 0 0 8px;
+ border-start-start-radius: 8px;
+ border-end-start-radius: 8px;
+ border-start-end-radius: 0;
+ border-end-end-radius: 0;
border: 1px solid var(--line);
- border-right: none;
+ border-inline-end: none;
background: var(--chrome, #f2f4f8);
}
.ed-split .ed-dropdown { display: flex; align-items: stretch; }
@@ -1567,7 +1570,10 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
height: 100%;
display: inline-flex;
align-items: center;
- border-radius: 0 8px 8px 0;
+ border-start-start-radius: 0;
+ border-end-start-radius: 0;
+ border-start-end-radius: 8px;
+ border-end-end-radius: 8px;
border: 1px solid var(--line);
background: var(--chrome, #f2f4f8);
padding: 6px 7px;
@@ -1578,10 +1584,10 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
/* quiet divider between share actions and advanced session controls */
.ed-share-sep { height: 1px; background: var(--line); margin: 2px 0; }
-/* bottom-right cluster: [Slideshow pill] [zoom pill] */
+/* bottom-end cluster: [Slideshow pill] [zoom pill] */
.ed-corner-br {
position: absolute;
- right: 14px;
+ inset-inline-end: 14px;
bottom: 14px;
display: flex;
align-items: center;
@@ -1660,18 +1666,26 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
}
}
.ed-present-pill .ed-pill-main {
- border-radius: 999px 0 0 999px;
- padding: 6px 10px 6px 14px;
+ border-start-start-radius: 999px;
+ border-end-start-radius: 999px;
+ border-start-end-radius: 0;
+ border-end-end-radius: 0;
+ padding-block: 6px;
+ padding-inline: 14px 10px;
font-weight: 600;
}
.ed-present-pill .ed-pill-caret {
- border-radius: 0 999px 999px 0;
- border-left: 1px solid var(--line);
- padding: 6px 10px 6px 7px;
+ border-start-start-radius: 0;
+ border-end-start-radius: 0;
+ border-start-end-radius: 999px;
+ border-end-end-radius: 999px;
+ border-inline-start: 1px solid var(--line);
+ padding-block: 6px;
+ padding-inline: 7px 10px;
}
.ed-present-pill .ed-btn:hover { background: var(--chrome, #f2f4f8); }
/* its menu drops UP (the pill sits at the bottom edge) */
-.ed-present-pill .ed-menu { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; }
+.ed-present-pill .ed-menu { top: auto; bottom: calc(100% + 6px); inset-inline-start: auto; inset-inline-end: 0; }
.ed-share-peers { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.ed-share-me {
@@ -1684,7 +1698,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
font-size: 12.5px;
}
.ed-share-me .who { font-weight: 600; }
-.ed-share-me .where { margin-left: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
+.ed-share-me .where { margin-inline-start: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ed-share-peer {
display: flex;
align-items: center;
@@ -1696,7 +1710,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
font-size: 12.5px;
color: var(--ink);
cursor: pointer;
- text-align: left;
+ text-align: start;
width: 100%;
}
.ed-share-peer:hover { background: rgba(94, 118, 153, 0.1); }
@@ -1730,7 +1744,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
content: '';
position: absolute;
top: 3px;
- right: 3px;
+ inset-inline-end: 3px;
width: 7px;
height: 7px;
border-radius: 50%;
@@ -1749,7 +1763,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
.ed-about-row .ed-btn {
max-width: 100%;
white-space: normal;
- text-align: left;
+ text-align: start;
}
.ed-about-meta-wrap { flex-direction: column; align-items: stretch; gap: 5px; }
.ed-about-h { font-weight: 700; font-size: 13px; margin: 2px 0; }
@@ -1827,26 +1841,29 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
box-shadow: 0 1px 4px rgba(20, 30, 45, 0.12);
}
.ed-panel-toggle:hover { color: var(--ink); border-color: #b9c3d2; }
-.ed-save-menu {
- right: 0;
- left: auto;
- min-width: 190px;
-}
+/* menus that hang off a topbar control at the END of the bar open toward the
+ bar's start, so they can never overflow the window edge — in either
+ direction (the language menu sets the same anchoring from JS). */
+.ed-save-menu, .ed-lang-menu {
+ inset-inline-end: 0;
+ inset-inline-start: auto;
+}
+.ed-save-menu { min-width: 190px; }
.ed-save-menu .ed-btn { font-size: 12.5px; }
/* when the adjacent panel is collapsed the chevron pins fully on-screen,
docked to the edge like a drawer pull */
.ed-sidebar.ed-collapsed + .ed-resizer .ed-panel-toggle {
- left: 0;
+ inset-inline-start: 0;
transform: translateY(-50%);
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
+ border-start-start-radius: 0;
+ border-end-start-radius: 0;
}
.ed-resizer:has(+ .ed-props.ed-collapsed) .ed-panel-toggle {
- left: auto;
- right: 0;
+ inset-inline-start: auto;
+ inset-inline-end: 0;
transform: translateY(-50%);
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
+ border-start-end-radius: 0;
+ border-end-end-radius: 0;
}
/* floating present buttons, bottom-LEFT of the work area (zoombar owns the