Repository navigation
feat: themes, and assets in the deck's own block - #19
Open
victorbahl wants to merge 2 commits into
Open
victorbahl wants to merge 2 commits into
victorbahl wants to merge 2 commits into
Conversation
data-themes="light dark" on <html> lists the themes in the file, and data-theme is the deck's. An element, a style block or a favicon with data-theme is only there in that theme. The theme button in the edit view gives the deck the next one, as an edit to undo or remove; Save writes it, and the thumbnails and the presenter view follow. There is no key for it in the show. A public copy keeps only the deck's theme, and the Suggest prompt says which one the deck is in.
… beside it
A deck can carry its images and fonts as data URIs in a
<script type="application/json" data-deck="assets"> at its end, one per
line. The slides name them: <img data-asset="x">, var(--asset-x) in CSS,
src:local("asset:x") in @font-face. The engine fills them in as the deck
opens and leaves the data out of what it writes: the saved slides, the
Suggest prompt, the thumbnails. A public copy keeps only the assets it
uses. A deck without the block works as before.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey Roald, last one of the series 🙂 Two commits again, and you can take the first without the second.
Several themes in one deck
Sometimes I have to present the same content under two brands, and keeping two files in step doesn't work:
data-themeis only there in that theme.Images and fonts in the file
This one goes a bit against the README, so feel free to say no. For a deck in a repo I agree: images belong beside it. But I send most of mine by email or Slack, and the files beside the HTML get lost on the way. It's called deckfile after all, so I wanted the whole deck in the file 🙂
It's opt-in: a block at the end holds them, one per line, and the slides only name them.
<img data-asset="x">,var(--asset-x)in CSS andsrc:local("asset:x")in@font-face.The README's advice on images stays the default, with a section on the block. A deck that uses neither stays as it is.
npm test: 13 node tests and 117 browser tests pass, 11 of them new.