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.
<h1>Responsive Borders</h1>
<h2>via Element Queries</h2>
<div id=one></div>
<div id=two></div>
<div id=three></div>
/* These two aren't responsive, but show what we want */
div {
margin: 4em auto;
width: 50px;
height: 50px;
border: 10px solid lime;
}
#two {
width: 200px;
height: 200px;
border: 40px solid lime;
}
/* This one IS responsive, using EW units for the border width */
@element #three {
$this {
width: 100%;
height: 100ew;
border: 20ew solid lime;
}
}
/* For more info on EW units -> https://tomhodgins.github.io/element-queries-spec/element-queries.html#ew */
Also see: Tab Triggers