{"id":362616,"date":"2022-02-07T07:24:44","date_gmt":"2022-02-07T15:24:44","guid":{"rendered":"https:\/\/css-tricks.com\/?p=362616"},"modified":"2022-02-07T07:24:46","modified_gmt":"2022-02-07T15:24:46","slug":"css-scroll-snap-slide-deck","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/css-scroll-snap-slide-deck\/","title":{"rendered":"CSS Scroll Snap Slide Deck That Supports Live Coding"},"content":{"rendered":"\n
Virtual conferences have changed the game in terms of how a presenter is able to deliver content to an audience. At a live event it\u2019s likely you just have your laptop, but at home, you may have multiple monitors so that you can move around windows and make off-screen changes when delivering live coding demos. However, as some events go back to in-person, you may be in a similar boat as me wondering how to bring an equivalent experience to a live venue.<\/p>\n\n\n\n
With a bit of creativity using native web functionality and modern CSS, like CSS scroll snap, we\u2019ll be building a no-JavaScript slide deck that allows live editing of CSS demos. The final deck will be responsive and shareable, thanks to living inside of a CodePen.<\/p>\n\n\n\n\n\n\n\n
To make this slide deck, we\u2019ll learn about:<\/p>\n\n\n\n
contenteditable<\/code> attribute<\/li>- Using custom properties and HSL for theming<\/li>
- Gradient text<\/li>
- Styling the
<style><\/code> element<\/li><\/ul>\n\n\nSlide templates<\/h3>\n\n\n
When making a slide deck of a bunch of different slides, it\u2019s likely that you\u2019ll need different types<\/em> of slides. So we\u2019ll create these three essential templates:<\/p>\n\n\n\n- Text:<\/strong> open for any text you need to include<\/li>
- Title:<\/strong> emphasizing a headline to break up sections of content<\/li>
- Demo:<\/strong> split layout with a code block and the preview<\/li><\/ul>\n\n\n\n\n\n