From 0add0f8d42616ae74231f4bfd9bf218cb368df1e Mon Sep 17 00:00:00 2001 From: Djidjelli Youcef Date: Fri, 20 Nov 2026 11:16:36 +0100 Subject: [PATCH] feat(player): keep a reading width on wide pages, centered --- .changeset/player-max-width.md | 5 +++++ packages/player/README.md | 1 + packages/player/src/style.css | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 .changeset/player-max-width.md diff --git a/.changeset/player-max-width.md b/.changeset/player-max-width.md new file mode 100644 index 0000000..29601ea --- /dev/null +++ b/.changeset/player-max-width.md @@ -0,0 +1,5 @@ +--- +'@interactive-learning/player': patch +--- + +On a wide page the player no longer stretches across it: it grows to 1100 px at most and stays centered. `--il-max-width` changes that width, and `none` lets it fill its container. Full screen still uses the whole screen. diff --git a/packages/player/README.md b/packages/player/README.md index 82ec58d..1211918 100644 --- a/packages/player/README.md +++ b/packages/player/README.md @@ -229,6 +229,7 @@ interactive-learning { | `--il-focus` | Keyboard focus ring | Accent or white | | `--il-radius` | Corner radius | `0px`, square corners | | `--il-screen-padding` | Room around the video | `12px`, `0` full width | +| `--il-max-width` | Widest the player grows, centered | `1100px`, `none` | The default look is plain, with square corners, a neutral accent and the page font. The video keeps 12 px of room on each side, 8 px at most in a narrow player and none in full screen; `--il-screen-padding: 0` runs it to the edges. diff --git a/packages/player/src/style.css b/packages/player/src/style.css index f78ee61..04ee504 100644 --- a/packages/player/src/style.css +++ b/packages/player/src/style.css @@ -26,6 +26,9 @@ --_bar-veil-middle: light-dark(rgb(255 255 255 / 78%), rgb(10 14 22 / 60%)); --_bar-veil-end: light-dark(rgb(255 255 255 / 94%), rgb(10 14 22 / 80%)); width: 100%; + /* On a wide page the player keeps a reading width, centered; full screen lifts it. */ + max-width: var(--il-max-width, 1100px); + margin-inline: auto; isolation: isolate; container: il-player / inline-size; border-radius: var(--_radius); @@ -951,6 +954,7 @@ display: flex; flex-direction: column; width: 100%; + max-width: none; height: 100dvh; max-height: 100dvh; margin: 0;