Skip to content

feat: add mdeck-* CSS class prefix alongside remark-* (backward compat)#12

Merged
dpecos merged 3 commits into
masterfrom
feat/mdeck-class-prefix
Apr 16, 2026
Merged

feat: add mdeck-* CSS class prefix alongside remark-* (backward compat)#12
dpecos merged 3 commits into
masterfrom
feat/mdeck-class-prefix

Conversation

@dpecos
Copy link
Copy Markdown
Contributor

@dpecos dpecos commented Apr 16, 2026

Summary

Introduces mdeck-* CSS class names as the canonical prefix for all elements created by mdeck, while keeping full backward compatibility with existing remark-* selectors.

What changed

CSS (src/styles/mdeck.css)

Every remark-* selector now has a comma-separated mdeck-* equivalent, so stylesheets targeting either prefix work without changes.

HTML template (src/mdeck/resources.ts)

Every element in the container layout now carries both remark-* and mdeck-* class names.

TypeScript

  • slideView: dual classes on container, scaler, slide, content, notes, code elements (inline code, code blocks, code lines, highlighted lines/spans)
  • slideshowView: dual classes on container element; all mode-class toggles (presenter, help, blackout, mirrored, pause) updated; internal getElementsByClassName queries migrated to mdeck-*
  • notesView: internal queries migrated to mdeck-*
  • slide-number: dual class on the slide number element
  • styler: stylesheet title changed to 'mdeck'; lookup falls back to 'remark' for backward compat
  • location: presenter-mode detection updated to mdeck-presenter-mode

Backward compatibility

  • All remark-* class names remain on every element — existing CSS and JS targeting those classes continues to work
  • Stylesheet lookup accepts both 'mdeck' and 'remark' titles
  • No breaking changes to the public API

dpecos and others added 3 commits April 16, 2026 11:14
For every remark-* CSS selector, add a comma-separated mdeck-* equivalent.
The remark-* selectors remain unchanged to ensure full backward
compatibility with existing stylesheets and user-defined CSS targeting
the old class names.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Each element in the containerLayout template now carries both
remark-* and mdeck-* class names side by side. Existing code
targeting remark-* classes continues to work unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- slideView: dual class names on all created elements (container,
  scaler, slide, incremental, content, notes, code blocks, code lines,
  highlighted spans/lines)
- slideshowView: dual class names on container element; all
  classList.toggle/add/remove calls updated for mode classes
  (presenter, help, blackout, mirrored, pause); getElementsByClassName
  queries migrated to mdeck-* (both classes are always present)
- notesView: getElementsByClassName queries migrated to mdeck-*
- slide-number: dual class on slide number element
- styler: stylesheet title changed to 'mdeck'; getRemarkStylesheet()
  falls back to 'remark' title for backward compat
- location.ts: classList.contains check updated to mdeck-presenter-mode

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dpecos dpecos merged commit 9f589d8 into master Apr 16, 2026
4 checks passed
@dpecos dpecos deleted the feat/mdeck-class-prefix branch April 16, 2026 09:25
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