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>Under-Engineered Text Boxen</h1>
<form action="#" autocomplete="off" method="get" novalidate>
<fieldset>
<legend>Assorted Fields</legend>
<div>
<label for="blather">Text area:</label>
<textarea id="blather" cols="20" rows="4">Lorem ipsum dolor sit amet.</textarea>
</div>
<div>
<label for="name">Text Input:</label>
<input type="text" id="name" value="Frank">
</div>
<div>
<label for="berries">Datalist:</label>
<input id="berries" type="text" list="berrylist" value="">
<datalist id="berrylist">
<option value="Blackberry">
<option value="Blueberry">
<option value="Boysenberry">
<option value="Chuckberry">
<option value="Cloudberry">
<option value="Cranberry">
<option value="Dewberry">
<option value="Elderberry">
<option value="Gooseberry">
<option value="Huckleberry, I’ll be your">
<option value="Lingonberry">
<option value="Loganberry">
<option value="Marionberry">
<option value="Mulberry">
<option value="Raspberry">
<option value="Snozzberry">
<option value="Strawberry">
<option value="Thimbleberry">
<option value="Wolfberry">
<option value="Youngberry">
</datalist>
</div>
</fieldset>
<fieldset>
<legend>Fields with Attributes</legend>
<div>
<label for="name-readonly">Read-only Text Input:</label>
<input type="text" id="name-readonly" value="Phrank" readonly>
</div>
<div>
<label for="name-required">Required Text Input:</label>
<input type="text" id="name-required" value="" required>
</div>
<div>
<label for="name-error">Errored Text Input:</label>
<input type="text" id="name-error" value="Ed" aria-invalid="true">
</div>
<div>
<label for="name-required-error">Errored Required Text Input:</label>
<input type="text" id="name-required-error" value="" required aria-invalid="true">
</div>
</fieldset>
<fieldset>
<legend>Disabled Fields</legend>
<div>
<label for="mumble">Mumble:</label>
<textarea id="mumble" cols="20" rows="4" disabled aria-disabled="true">Lorem ipsum dolor sit amet.</textarea>
</div>
<div>
<label for="name2">Assigned Name:</label>
<input type="text" id="name2" value="Still Frank" disabled aria-disabled="true">
</div>
</fieldset>
<fieldset dir="rtl" lang="iw">
<legend>שדות שונים</legend>
<div>
<label for="RTLblather">לקשט:</label>
<textarea id="RTLblather" cols="20" rows="4">Lorem ipsum dolor לשבת אמט.</textarea>
</div>
<div>
<label for="RTLname">שם פרטי:</label>
<input type="text" id="RTLname" value="Frank" aria-invalid="true">
</div>
<div>
<label for="RTLberries">ברי?</label>
<input id="RTLberries" type="text" list="RTLberrylist" value="">
<datalist id="RTLberrylist">
<option value="Blackberry">
<option value="Blueberry">
<option value="Boysenberry">
<option value="Chuckberry">
<option value="Cloudberry">
<option value="Cranberry">
<option value="Dewberry">
<option value="Elderberry">
<option value="Gooseberry">
<option value="Huckleberry, I’ll be your">
<option value="Lingonberry">
<option value="Loganberry">
<option value="Marionberry">
<option value="Mulberry">
<option value="Raspberry">
<option value="Snozzberry">
<option value="Strawberry">
<option value="Thimbleberry">
<option value="Wolfberry">
<option value="Youngberry">
</datalist>
</div>
<div>
<label for="RTLname-required">נדרש:</label>
<input type="text" id="RTLname-required" value="" required>
</div>
</fieldset>
<fieldset>
<legend>Assorted Inputs</legend>
<details>
<summary>Show them all</summary>
<div>
<input type="button" value="button">
</div>
<div>
<input type="checkbox" value="checkbox">
</div>
<div>
<input type="color" value="color">
</div>
<div>
<input type="date" value="date">
</div>
<div>
<input type="datetime-local" value="datetime-local">
</div>
<div>
<input type="email" value="email">
</div>
<div>
<input type="file" value="file">
</div>
<div>
<input type="hidden" value="hidden">
</div>
<div>
<input type="image" value="image">
</div>
<div>
<input type="month" value="month">
</div>
<div>
<input type="number" value="number">
</div>
<div>
<input type="password" value="password">
</div>
<div>
<input type="radio" value="radio">
</div>
<div>
<input type="range" value="range">
</div>
<div>
<input type="reset" value="reset">
</div>
<div>
<input type="search" value="search">
</div>
<div>
<input type="submit" value="submit">
</div>
<div>
<input type="tel" value="tel">
</div>
<div>
<input type="text" value="text">
</div>
<div>
<input type="time" value="time">
</div>
<div>
<input type="url" value="url">
</div>
<div>
<input type="week" value="week">
</div>
<div>
<input type="datetime" value="datetime">
</div>
</details>
</fieldset>
</form>
body {
font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
line-height: 1.4;
/* line-height: 1.5; */
/* letter-spacing: 0.12em; */
/* word-spacing: 0.16em; */
/* font-size: 200%; */
}
@media print {
body {
font-size: 8pt;
}
}
/*-- forms --*/
form {
background-color: #fff;
padding: 0.5em 1em;
display: grid;
grid-template-columns: repeat(2, [col] 1fr );
}
fieldset {
padding: 0 1em;
margin: 0 0.5em 1em 0.5em;
}
fieldset:last-child {
grid-column: span 2;
}
form details div {
display: inline-block;
margin: .25em;
}
details {
margin: 1em 0;
}
summary {
margin-bottom: 1em;
}
form div {
box-sizing: border-box;
margin: 1em 0;
}
label {
display: block;
margin: 0.25em 0;
}
/* Text fields */
textarea,
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"]) {
font: inherit;
letter-spacing: inherit;
word-spacing: inherit;
border: 0.1em solid;
padding: 0 0.2em;
}
/* Focus */
textarea:focus,
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"]):focus {
outline: 0.15em solid #00f;
box-shadow: 0 0 0.2em #00f;
}
/* Read-only */
textarea[readonly],
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"])[readonly] {
border-color: rgba(0, 0, 0, 0.42);
border-left: none;
border-top: none;
border-right: none;
}
/* Errored */
textarea[aria-invalid="true"],
textarea[aria-invalid="spelling"],
textarea[aria-invalid="grammar"],
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"])[aria-invalid] {
background: linear-gradient(135deg, rgba(255,0,0,1) 0, rgba(255,0,0,1) .4em, rgba(255,255,255,1) .4em);
}
/* RTL Errored */
*[dir="rtl"] textarea[aria-invalid="true"],
*[dir="rtl"] textarea[aria-invalid="spelling"],
*[dir="rtl"] textarea[aria-invalid="grammar"],
*[dir="rtl"] input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"])[aria-invalid] {
background: linear-gradient(225deg, rgba(255,0,0,1) 0, rgba(255,0,0,1) .4em, rgba(255,255,255,1) .4em);
}
/* Required */
textarea[required],
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"])[required] {
border-left-width: 0.3em;
}
/* RTL Required */
*[dir="rtl"] textarea[required],
*[dir="rtl"] input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"])[required] {
border-left-width: 0.1em;
border-right-width: 0.3em;
}
/* Dark mode */
@media screen and (prefers-color-scheme: dark) {
form {
background-color: #000;
color: #fff;
}
textarea,
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"]) {
background-color: transparent;
color: inherit;
border-color: #ccc;
}
textarea:focus,
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"]):focus {
outline-color: #0ff;
box-shadow: 0 0 0.2em #0ff;
}
textarea:disabled,
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"]):disabled {
border-color: rgba(255,255,255,.3);
color: rgba(255,255,255,.3);
background-color: rgba(255,255,255,.1);
}
textarea[readonly],
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"])[readonly] {
border-color: #777;
}
textarea[aria-invalid],
input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"])[aria-invalid] {
background: linear-gradient(135deg, rgba(238,0,0,1) 0, rgba(238,0,0,1) .3em, rgba(0,0,0,0) .3em);
}
*[dir="rtl"] textarea[aria-invalid],
*[dir="rtl"] input:not([type="checkbox"]):not([type="file"]):not([type="image"]):not([type="radio"]):not([type="range"])[aria-invalid] {
background: linear-gradient(225deg, rgba(238,0,0,1) 0, rgba(238,0,0,1) .3em, rgba(0,0,0,0) .3em);
}
}
Also see: Tab Triggers