<ol id="slides">
<li class="slide slide--text">
<div class="content">
<h1>Presentation Title</h1>
<p>Presented by Your Name</p>
<p><a target="_blank" href="https://twitter.com/5t3ph">@5t3ph</a></p>
</div>
</li>
<li class="slide slide--title" data-topic="CSS">
<div class="content">
<h2>Topic 1</h2>
</div>
</li>
<li class="slide slide--demo" data-topic="CSS">
<div class="style">
<style contenteditable="true">
.modern-container {
--container-width: 40ch;
width: min(
var(--container-width), 100% - 3rem
);
margin-inline: auto;
}
</style>
</div>
<div class="demo">
<div class="modern-container">
<div class="box">container</div>
</div>
</div>
</li>
</ol>
:root {
--theme-hue: 230;
--theme-saturation: 85%;
--theme-hs: var(--theme-hue), var(--theme-saturation);
}
* {
margin: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
font-family: system-ui, sans-serif;
font-size: 1.5rem;
background-color: hsl(var(--theme-hs), 95%);
color: hsl(var(--theme-hs), 25%);
}
body,
#slides,
.slide {
display: grid;
}
#slides {
list-style: none;
padding: 0;
margin: 0;
counter-reset: slides;
}
@media screen and (min-width: 120ch) {
#slides {
grid-auto-flow: column;
overflow-x: auto;
scroll-snap-type: x mandatory;
}
}
.slide {
position: relative;
counter-increment: slides;
}
@media screen and (min-width: 120ch) {
.slide {
width: 100vw;
height: 100vh;
scroll-snap-align: center;
scroll-snap-stop: always;
}
}
@media (max-width: 120ch) {
.slide {
min-height: 80vh;
}
.slide + .slide {
border-top: 1px dashed;
}
}
.slide::before {
content: counter(slides);
position: absolute;
top: 0.25rem;
left: 0.25rem;
width: 1.65em;
height: 1.65em;
display: grid;
place-content: center;
border-radius: 50%;
font-size: 1.25rem;
color: hsl(var(--theme-hs), 95%);
background-color: hsl(var(--theme-hs), 55%);
}
@media (min-width: 120ch) {
.slide::before {
top: auto;
bottom: 1rem;
left: 1rem;
}
}
[data-topic]::before {
content: counter(slides) ": " attr(data-topic);
padding: 0.25em 0.4em;
width: auto;
border-radius: 0.5rem;
}
.slide--text,
.slide--title {
place-content: center;
}
.slide--title {
background-image:
linear-gradient(125deg,
hsl(var(--theme-hs), 95%),
hsl(var(--theme-hs), 75%)
);
}
@media screen and (min-width: 120ch) {
.slide--demo {
grid-template-columns: fit-content(85ch) 1fr;
}
}
h1, h2 {
line-height: 1.1;
}
h1 {
font-size: clamp(2rem, 8vw + 1rem, 3.25rem);
}
a {
color: inherit;
}
.content {
padding: 2rem;
font-size: 2rem;
line-height: 1.5;
width: calc(100vw - 2rem);
}
.content * + * {
margin-top: 0.5em;
}
@media screen and (min-width: 120ch) {
.content {
width: unset;
max-width: 45ch;
}
}
.slide--text .content {
max-width: 40ch;
}
.style {
display: grid;
align-items: center;
background-color: hsl(var(--theme-hs), 5%);
padding-inline: max(5vw, 2rem) 3rem;
font-size: 1.35rem;
overflow-y: hidden;
resize: horizontal;
}
style {
--line-height: 1.65em;
--highlight-start: calc(2 * var(--line-height));
--lines: calc(var(--highlight-start) + var(--num-lines, 1) * var(--line-height));
display: block;
outline: none;
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
color: hsl(var(--theme-hs), 75%);
background: none;
white-space: pre;
line-height: 1.65;
tab-size: 2;
hyphens: none;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
background-image: linear-gradient(
hsl(var(--theme-hs), 75%) 0 var(--highlight-start),
hsl(var(--theme-hs), 90%) var(--highlight-start) var(--lines),
hsl(var(--theme-hs), 75%) var(--lines) 100%
);
}
.highlight--rule-only {
--highlight-start: calc(1 * var(--line-height))
}
.highlight--none {
background-image: none;
background-color: currentColor;
}
.demo {
padding: 2rem;
}
.box {
background-color: hsl(var(--theme-hs), 85%);
border: 2px dashed;
border-radius: .5em;
padding: 1rem;
font-size: 1.35rem;
text-align: center;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.