Skip to content

Style the YOURLS 1.10 delete-confirmation dialog#154

Open
toineenzo wants to merge 4 commits into
Flynntes:masterfrom
toineenzo:style-yourls-delete-confirm-dialog
Open

Style the YOURLS 1.10 delete-confirmation dialog#154
toineenzo wants to merge 4 commits into
Flynntes:masterfrom
toineenzo:style-yourls-delete-confirm-dialog

Conversation

@toineenzo

@toineenzo toineenzo commented Apr 26, 2026

Copy link
Copy Markdown

Problem

YOURLS 1.10 replaced the old jquery-notify-bar delete confirmation with a native <dialog id="delete-confirm-dialog"> and shipped it with a hard-coded white/blue palette (background #ffffff, header #c7e7ff, border #2a85b3). On Sleeky-backend that pops up as a bright white card with light-blue borders dropped right on top of the dark surface — completely ignoring the active theme.

Before — vanilla YOURLS chrome on Sleeky-dark After — re-skinned to the active theme
Vanilla YOURLS delete-confirm dialog: white background, light-blue header, hard blue border, sitting on top of Sleeky's dark surface Re-skinned dialog: dark `$default` body, accent border, `$light` header band with `$title` text, `$light` footer with the existing input.button styling

Fix

Re-skin #delete-confirm-dialog and its children using the existing theme variables ($default / $light / $accent / $title / $text / $lightest) so it picks up the dark or light palette automatically.

Element Treatment
Dialog body $default background, $accent border, heavier drop shadow
Header (div[name="dialog_title"]) $light band with $title text and $accent bottom rule
Message body Keeps the dialog background; the inner <ul> keeps its $accent left border but the <span> value chips now sit on $light with a $lightest border so they read as cards instead of light-blue tags
Button group $light footer band the existing input.button / input[type="submit"] rules already render correctly on; the cancel button (last input[type="submit"] in the group) gets a muted left border so it isn't visually identical to the destructive Delete
::backdrop Dimmed to a uniform rgba(0, 0, 0, 0.7)
Sizing height: fit-content + max-height: 90vh + explicit inset: 0; margin: auto so the dialog fits its content and stays centered (height: auto was being resolved against body { display: inline } and stretching to 100vh on Sleeky)

Light theme keeps the rounded corners (6px) for parity with the rest of Sleeky-light; dark theme stays flat to match the existing flat aesthetic.

Files touched

File Change
sleeky-backend/assets/css/_base.scss New #delete-confirm-dialog block (~100 lines, gated on $theme for the corner-radius difference)
sleeky-backend/assets/css/dark.css Regenerated
sleeky-backend/assets/css/light.css Regenerated

Both compiled CSS files regenerated with the same Sass invocation as npm start in package.json, just driven by Dart Sass instead of the deprecated node-sass:

sass --no-source-map --style=compressed \
  assets/css/themes/dark.scss:assets/css/dark.css \
  assets/css/themes/light.scss:assets/css/light.css

How to test

  1. Apply the patch to a YOURLS install with Sleeky-backend active (either theme).
  2. Open the link list at /admin/index.php.
  3. Click the trash / Delete action on any link.
  4. The delete-confirmation dialog should now match Sleeky's surface — dark card on Sleeky-dark, white card on Sleeky-light — instead of the vanilla YOURLS white-on-blue, and it should sit centered at content size instead of stretching to 100vh.

Verified on YOURLS 1.10.3 + PHP 8.4 with Sleeky-backend's dark theme on a live install.

toineenzo and others added 4 commits April 26, 2026 04:09
YOURLS 1.10 dropped the old jquery-notify-bar delete confirmation in
favour of a native <dialog id="delete-confirm-dialog"> with hard-coded
white/blue chrome (background #ffffff, header #c7e7ff, border #2a85b3).
On the Sleeky surface that pops up as a bright white card with light
blue borders that completely ignores the active theme.

Re-skin it to use the existing $default / $light / $accent / $title /
$text / $lightest theme variables so it picks up the dark or light
palette automatically:

- Dialog body uses $default with a $accent border and a heavier shadow.
- Header (div[name="dialog_title"]) sits on $light with $title text and
  a $accent bottom border.
- Message body keeps the dialog background; the inner <ul> keeps its
  accent left border but the <span> values now sit on $light with a
  $lightest border so they read as cards instead of light-blue tags.
- Button group uses the $light footer band the existing input.button /
  input[type="submit"] rules already render correctly on. The cancel
  button (last input[type=submit] in the group) gets a muted left
  border so it doesn't look identical to the destructive Delete one.
- ::backdrop dimmed to a uniform rgba(0,0,0,0.7).

Light theme keeps the rounded corners (6px) for parity with the rest
of Sleeky-light; dark theme stays flat to match the existing flat
aesthetic.

Both compiled themes (dark.css, light.css) regenerated with
`sass --no-source-map --style=compressed` from the corresponding
source files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reported on a live YOURLS install with Sleeky-backend dark theme: the
re-skinned #delete-confirm-dialog rendered with the body content at the
top but the dialog box itself stretching from y=0 to y=100vh.

Cause: the previous patch set `height: auto` on the dialog. With
Sleeky's `body { display: inline }` the auto value resolved to the
viewport height instead of fitting the children.

Fix:
- height: fit-content + max-height: 90vh -- explicitly tells the
  browser to size the dialog to its actual contents and never grow
  past 90% of the viewport.
- inset: 0 + margin: auto -- pin the showModal()-positioned dialog
  back to the viewport center so it doesn't drift after the size
  change.
- overflow: hidden -- clip the rounded-corner border consistently.

Both compiled themes (dark.css, light.css) regenerated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant