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.
<div class="container">
<h1>Dark UI Kit</h1>
<h2>Form Elements</h2>
<div class="checkbox block">
<em>Checkboxes</em>
<input type="checkbox" id="checkbox1">
<label for="checkbox1">Option One</label>
<input type="checkbox" id="checkbox2">
<label for="checkbox2">Option Two</label>
<input type="checkbox" id="checkbox3">
<label for="checkbox3">Option Three</label>
<input type="checkbox" id="checkbox4">
<label for="checkbox4">Option Four</label>
</div>
<div class="radio block">
<em>Radio Buttons</em>
<form>
<input type="radio" id="radio1" name="radio-group">
<label for="radio1">Option One</label>
<input type="radio" id="radio2" name="radio-group">
<label for="radio2">Option Two</label>
<input type="radio" id="radio3" name="radio-group">
<label for="radio3">Option Three</label>
<input type="radio" id="radio4" name="radio-group">
<label for="radio4">Option Four</label>
</form>
</div>
<div class="text-input block">
<form>
<em>Text Inputs</em>
<div class="form-group">
<input type="text" id="username" />
<label for="username">Username</label>
</div>
<div class="form-group">
<input type="password" id="password" />
<label for="password">Password</label>
</div>
</form>
</div>
<div class="text-input stacked block">
<form>
<em>Text Inputs (Stacked)</em>
<div class="form-group">
<input type="text" id="username2" />
<label for="username2">Username</label>
</div>
<div class="form-group">
<input type="password" id="password2" />
<label for="password2">Password</label>
</div>
</form>
</div>
</div>
/* webfont */
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300');
/* setup */
body {
font: 14px 'Open Sans', sans-serif;
background: @darkbg;
color: @silver-light;
}
* { box-sizing: border-box; }
.container {
width: 600px;
margin: 40px auto;
background: @default;
padding: 20px;
border: 5px solid @default-dark;
.box-shadow(0 0 24px rgba(0,0,0,0.12));
h1, h2 { padding: 0; margin: 0; .font-smooth; text-align: center; }
h1 { font-weight: 300; font-size: 36px; line-height: 1.2em; }
h2 { font-size: 16px; line-height: 1.4em; margin-bottom: 20px; }
.block {
padding: 10px;
border: 2px solid @default-light;
margin-top: 6px;
em {
text-align: right;
display: block;
font-style: normal;
color: @silver-darker;
margin-top: -4px;
margin-bottom: 4px;
font-size: 12px;
}
}
}
/* form ui variables */
@checkbox-radius: 6px;
@ui-checkbox-size: 20px;
@ui-checkbox-offset: 2px; /* unfortunate hack to get precise vertical alignment */
@input-radius: 6px;
@font-size: 14px;
@label-width: 16%; /* set percent, stacked view only */
/* form elements */
.checkbox, .radio {
form { display: inline-block; }
input, label { cursor: pointer; }
input {
opacity: 0;
position: absolute;
+ label {
line-height: @ui-checkbox-size + 2;
display: inline-block;
padding: 2px;
margin: @ui-checkbox-offset @ui-checkbox-size - 12 -@ui-checkbox-offset 0;
.transition;
&:before {
content: '';
display: inline-block;
vertical-align: middle;
position: relative;
top: -@ui-checkbox-offset;
margin-right: 6px;
border-radius: @checkbox-radius;
height: @ui-checkbox-size;
width: @ui-checkbox-size;
border: 2px solid @default-lighter;
.transition;
}
&:hover {
color: @silver;
&:before {
border-color: @green-bright;
}
}
}
&:checked {
+ label {
color: @green-bright;
&:before {
background: @green-bright;
border-color: @default-lighter;
}
&:hover:before {
border-color: @green-bright;
}
}
}
}
}
.radio input + label:before { border-radius: 50%; }
.text-input {
input {
border-radius: @input-radius;
outline: none;
line-height: @font-size;
font-size: @font-size;
padding: 4px 8px;
margin-right: 6px;
background: transparent;
border: 2px solid @default-lighter;
.transition;
&:focus {
border-color: @silver-dark;
color: @silver-light;
}
}
label {
position: relative;
float: left;
top: 6px;
margin-right: 10px;
color: @silver-dark;
cursor: pointer;
.transition;
}
input:focus + label { color: @silver-light; }
.form-group { display: inline-block; }
}
.stacked {
.form-group {
width: 100%;
display: block;
margin-bottom: 6px;
label { width: @label-width; margin: 0; }
input { width: 100 - @label-width; margin: 0; }
}
}
/* color variables */
@darkbg: #1f2336;
@default-lighter: #535a83;
@default-light: #474c6c;
@default: #3c405c;
@default-dark: #343850;
@default-darker: #2a2d3e;
@silver-lighter: #eff5ff;
@silver-light: #d3d7e3;
@silver: #aeb8d6;
@silver-dark: #a4abc1;
@silver-darker: #8690af;
@green-bright: #3cff85;
@green-transparent: rgba(60, 255, 133, 0.7);
/* mixins */
.transition(@duration:0.25s, @ease:ease-in-out) {
-webkit-transition: all @duration @ease;
-moz-transition: all @duration @ease;
-o-transition: all @duration @ease;
transition: all @duration @ease;
}
.font-smooth(@fontsmooth: antialiased, @mozfontsmooth: grayscale ) {
-webkit-font-smoothing: @fontsmooth;
-moz-osx-font-smoothing: @mozfontsmooth;
font-smoothing: @fontsmooth;
text-rendering: optimizeLegibility;
}
.box-shadow(@arguments) {
-webkit-box-shadow: @arguments;
-moz-box-shadow: @arguments;
box-shadow: @arguments;
}
Also see: Tab Triggers