JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
HTML Settings
Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
<h1>Accessible Drop Caps</h1>
<div>
<div>
<h2>Incorrect</h2>
<p>
<span aria-labelledby="word--first" role="text">
<span aria-hidden="true">
<span class="dropcap">M</span>atthew
</span>
<span id="word--first" class="hidden">Matthew</span>
</span>
watched the storm, so beautiful yet terrific. Mist enveloped the ship three hours out from port. Waves flung themselves at the blue evening. Silver mist suffused the deck of the ship. I watched the storm, so beautiful yet terrific. Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Nulla pellentesque elit justo, nec rutrum leo pulvinar vel.
</p>
</div>
<div>
<h2>Not Incorrect</h2>
<p>
<span aria-hidden="true" class="drop">
<span>M</span>atthew
</span>
<span class="visually-hidden">Matthew</span> watched the storm, so beautiful yet terrific. Mist enveloped the ship three hours out from port. Waves flung themselves at the blue evening. Silver mist suffused the deck of the ship. I watched the storm, so beautiful yet terrific.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla pellentesque elit justo, nec rutrum leo pulvinar vel.
</p>
</div>
<div>
<h2>Standard CSS</h2>
<p>
Matthew watched the storm, so beautiful yet terrific. Mist enveloped the ship three hours out from port. Waves flung themselves at the blue evening. Silver mist suffused the deck of the ship. I watched the storm, so beautiful yet terrific. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla pellentesque elit justo, nec rutrum leo pulvinar vel.
</p>
</div>
</div>
@import url('https://fonts.googleapis.com/css?family=Playfair+Display&display=swap');
body {
font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
line-height: 1.4;
color: #333;
background-color: #eee;
}
body > div {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
body > div div {
flex: 0 1 15em;
margin: 0 1em;
}
/* Styles from another demo */
.dropcap {
font-family: "Playfair Display", serif;
font-size: 5.5rem;
float: left;
line-height: 1;
margin-right: 0.05em;
/* outline: 1px solid #f00; */
}
.dropcap:before,
.dropcap:after {
content: "";
display: block;
}
.dropcap:before {
/* margin-bottom: -0.175em; */
margin-bottom: -0.21em;
}
.dropcap:after {
margin-top: -0.05em;
}
/* The revised pattern */
/* Selector to enforce the pattern */
p > span[aria-hidden=true].drop span {
font-family: "Playfair Display", serif;
font-size: 5.5rem;
float: left;
line-height: 1;
margin-right: 0.05em;
/* outline: 1px solid #f00; */
}
p > span[aria-hidden=true].drop span::before,
p > span[aria-hidden=true].drop span::after {
content: "";
display: block;
}
p > span[aria-hidden=true].drop span::before {
/* margin-bottom: -0.175em; */
margin-bottom: -0.21em;
}
p > span[aria-hidden=true].drop span::after {
margin-top: -0.05em;
}
.visually-hidden, .hidden {
position: absolute;
top: auto;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
width: 1px;
height: 1px;
white-space: nowrap;
}
/* You can use a class; I was just being a brat */
body > div div:last-of-type p:first-letter {
font-family: "Playfair Display", serif;
font-size: 5.5rem;
float: left;
line-height: .6; /* from 1 */
margin-right: 0.05em;
}
Also see: Tab Triggers