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.
<form class="ui form">
<div class="ui cards">
<div class="card">
<div class="content">
<div class="ui teal header">input</div>
<div class="description">
<div class="field">
<input type="text" required>
<label>Email</label>
</div>
<div class="field">
<input type="password" required>
<label>Password</label>
</div>
</div>
</div>
</div>
<div class="card">
<div class="content">
<div class="ui teal header">textarea</div>
<div class="description">
<div class="field">
<textarea required></textarea>
<label>Start typing...</label>
</div>
</div>
</div>
</div>
<div class="card">
<div class="content">
<div class="ui teal header">select</div>
<div class="description">
<div class="field select">
<select required="required">
<option value=""></option>
<option value="">This is a selected option</option>
</select>
<label>Select</label>
</div>
</div>
</div>
</div>
<div class="card">
<div class="content">
<div class="ui teal header">checkbox</div>
<div class="description">
<div class="meta">This solution does not work in IE/Edge desktop</div>
<div class="field checkbox">
<input type="checkbox" required>
<label>checkbox</label>
</div>
<div class="field checkbox">
<input type="checkbox" required checked>
<label>checkbox</label>
</div>
</div>
</div>
</div>
</div>
</form>
body {
background: powderblue;
margin: 10%;
* {
outline: none;
}
}
.ui.form {
.field {
position: relative;
width: 100%;
&:not(.checkbox) {
margin-top: 1rem;
margin-bottom: 1.7rem;
}
label {
color: lightgrey;
position: absolute;
left: .7rem;
top: .7rem;
transition: .2s ease-in;
}
&.select {
display: flex;
&:after {
align-self: center;
color: lightgrey;
content: "\f107";
font-family: "Icons";
margin-left: -1rem;
}
select {
background: transparent;
border: none;
border-bottom: 2px solid lightgrey;
padding: .7rem 2rem .7rem .7rem;
position: relative;
border-radius: 0;
// Chrome and Safari both ignore border-radius on <select>
// elements unless -webkit-appearance is overridden to an appropriate value.
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
-webkit-appearance: none;
-moz-appearance: none;
transition: .2s ease-in;
&:focus {
outline: none !important;
border-bottom: 2px solid dodgerblue !important;
}
&:focus ~ label,
&:valid ~ label {
color: gray;
font-size: 80%;
top: -1rem;
left: 0;
}
}
}
input:not([type=checkbox]),
textarea {
background: transparent;
border: none;
border-bottom: 2px solid lightgrey;
border-radius: 0;
padding: .7rem;
transition: .2s ease-in;
&[value=" "] {
background: grey !important;
}
&:focus ~ label,
&:valid ~ label {
color: grey;
font-size: 80%;
top: -1rem;
left: 0;
}
&:focus {
border-bottom: 2px solid dodgerblue;
outline: none;
}
}
&.checkbox {
align-items: flex-start;
align-content: flex-start;
display: flex;
margin: .7rem 0;
position: relative;
input[type=checkbox] {
padding: .7rem;
border: 2px solid lightgrey;
transition: .2s ease-in;
-webkit-appearance: none;
-moz-appearance: none;
&:focus {
outline: none;
}
&:before {
color: grey;
content: "";
transition: .2s ease-in;
}
&:checked {
padding: .6rem .35rem;
margin: -.3rem .1rem 0 .7rem;
border-left: none;
border-top: none;
transform: rotate(45deg);
}
}
label {
font-size: initial;
position: static;
margin-left: 1rem;
align-self: center;
}
}
}
}
Also see: Tab Triggers