Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slide parts (and mark private methods) #11

Merged
merged 20 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ until we achieve a stable v1.0 release

## v0.1.2 - unreleased

- 🚀 NEW: Add support for slide parts – `slide-canvas` & `slide-note`
(these parts require light DOM styles)
- 🚀 NEW: Slide parts can be hidden
with the `hide-parts="note | canvas"` attribute
(both parts cannot be hidden at the same time)
- 🚀 NEW: Add support for `hide-part="note | canvas"` buttons
to toggle hiding the notes and canvass
- 💥 BREAKING: Removed the shadow DOM content wrapper,
and all shadow DOM styles
- 💥 BREAKING: Renamed and added control-panel parts,
Expand Down
48 changes: 46 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,56 @@ <h2>Open Source</h2>
<a href="https://github.com/oddbird/slide-deck/">github.com/oddbird/slide-deck/</a>
</p>
</div>

<div>
<div slide-canvas>
<h2>Speaker Notes</h2>
<pre><code>&lt;div&gt;
&lt;div slide-canvas&gt;
This slide has both a canvas
&lt;/div&gt;
&lt;div slide-note&gt;
And a section for notes
&lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
<div slide-note>
<p>
Within a slide element,
we can provide both a 'canvas' and a 'note'!
For styling purposes:
</p>
<ul>
<li>
A slide without nested parts
will be labeled
with the <code>slide-canvas</code> attribute
</li>
<li>
A slide with internal parts
will be labeled
as a <code>slide-container</code> instead
</li>
</ul>
</div>
</div>
<div>
<div slide-canvas>
<h3>Hiding parts</h3>
<button hide-part="note">hide notes</button>
<button hide-part="canvas">hide canvas</button>
</div>
<div slide-note>
<p>
These parts can be shown or hidden separately,
but you can never hide both at once.
</p>
</div>
</div>
<div><h2>To Do…</h2></div>
<div><h3>… Speaker Notes</h3></div>
<div><h3>… Slide Templates</h3></div>
<div><h3>… CSS Themes</h3></div>
<div><h3>… More Better Good Stuff</h3></div>
</slide-deck>

</body>
</html>
8 changes: 6 additions & 2 deletions slide-deck.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ slide-deck {
--blank-color: white;
}

[id^=slide_] {
[slide-canvas] {
aspect-ratio: var(--slide-ratio);
border: thin solid;
box-sizing: border-box;
Expand All @@ -42,6 +42,10 @@ slide-deck {
}
}

[slide-note] {
margin-block: var(--gap);
}

&::part(control-panel) {
min-width: min(50ch, 100%);
padding: 0;
Expand All @@ -67,7 +71,7 @@ slide-deck {
}

[aria-pressed=true],
&::part(button pressed) {
&::part(pressed) {
border-color: currentColor;
}
}
Loading