Skip to content

Split host-UI CSS into opt-in files and parameterise the overlay id - #24

Open
namedgraph wants to merge 7 commits into
masterfrom
feature/ldh-integration-seams
Open

Split host-UI CSS into opt-in files and parameterise the overlay id#24
namedgraph wants to merge 7 commits into
masterfrom
feature/ldh-integration-seams

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Summary

Separates the editor's host-UI styling from its intrinsic styling so host applications (e.g. LinkedDataHub with Bootstrap) can supply their own look without fighting upstream rules:

  • rdfa-editor.css now contains only editor-intrinsic styles (content highlighting, block chrome, drag-drop, slash menu, drawers)
  • overlay.css — the annotation overlay form (Material-style default)
  • toolbar.css — the #edit-toolbar button/group styling
  • dialogs.css — the .edit-dialog popups (link/figure/table insert)

Hosts that provide their own styling omit the three opt-in files; standalone users load all four (as index.html and the test fixtures now do).

  • The annotation overlay id is parameterised as $local:overlay-id (default rdfa-editor-overlay) so hosts can shadow it; the previous bare overlay id was collision-prone in host pages
  • Browser tests and all four fixtures updated accordingly (#rdfa-editor-overlay selectors, getElementById calls, split CSS <link>s — without dialogs.css the dialogs lost their z-index and the fixed nav/breadcrumb intercepted pointer events, causing the earlier CI timeouts)

Test plan

  • make test (RDFa extraction, lint, canonicalization suites)
  • make test-browser (editor, tables, typeahead, blocks and the rest of the Playwright suites — previously failing on pointer-event interception, green with the fixture CSS links in place)

🤖 Generated with Claude Code

namedgraph and others added 7 commits July 28, 2026 01:55
…lay id

rdfa-editor.css no longer contains the annotation overlay or editor toolbar
styles — host UIs that provide their own design system (e.g. Bootstrap) should
omit overlay.css and toolbar.css and style #rdfa-editor-overlay / #edit-toolbar
themselves.

- overlay.css: extracted #rdfa-editor-overlay, .rdfa-editor-ui .btn-*, typeahead
  styles (formerly lines 600–885 of rdfa-editor.css)
- toolbar.css: extracted #edit-toolbar layout and button styles (formerly lines
  156–283 of rdfa-editor.css)
- src/overlay.xsl: add $local:overlay-id variable (default 'rdfa-editor-overlay');
  use it in local:render-overlay, local:show-overlay, local:hide-overlay and the
  ixsl:onkeydown match pattern so host UIs can shadow the id without forking the
  templates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Follows the rename of the overlay element id introduced in the previous
commit (parameterised via $local:overlay-id).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move toolbar insertion dialog styles (link, table, figure) into a separate
dialogs.css alongside overlay.css and toolbar.css. Host UIs that provide
their own form styling should omit this file and style .edit-dialog themselves.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The earlier selector sweep only caught #overlay CSS selectors; three files
still used getElementById('overlay') in JS evaluate() callbacks, causing
getComputedStyle() to receive null and crash the test runner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These files were split out of rdfa-editor.css; the demo page must load all
three so the annotation overlay, editor toolbar and insertion dialogs are
styled correctly for non-Bootstrap users.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After the CSS split, z-index: 10000 for .edit-dialog moved from
rdfa-editor.css to dialogs.css. Without dialogs.css in fixture.html,
dialogs had no z-index and rendered behind the fixed nav (z-index:1000),
causing pointer-event interception failures in editor, tables and blocks
tests. Same applies to overlay.css for the annotation overlay.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fixture.html was fixed in d67322d but fixture-blocks.html,
fixture-dragnest.html and fixture-nesting.html also load only
rdfa-editor.css. Without dialogs.css the ldh-block dialog has no
z-index and the fixed breadcrumb footer intercepts its button clicks
(blocks.mjs:222 TimeoutError).

Co-Authored-By: Claude Fable 5 <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