HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<main class="wrapper todo__app">
<div class="app__header">
<div class="container-fluid">
<ul class="app__nav">
<li>
<a class="nav__menu-icon" href="#"><i class="material-icons">menu</i></a>
</li>
<li>
<a class="app__logo" href="#">
<i class="material-icons">spa</i>
</a>
</li>
<li>
<a class="nav__user" href="#"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/30184/profile/profile-80_3.jpg" alt="" />Alex Devero</a>
</li>
</ul>
</div>
</div>
<div class="container-fluid app__body">
<div class="row">
<div class="col-md-3">
<section class="todo__col todo--mit">
<div class="col__heading">
<h1>
<span>Most Important Tasks (3)</span>
<a href="#">
<i class="material-icons">more_vert</i>
</a>
</h1>
</div>
<div class="col__feed">
<div class="todo__item">
<h2 class="item__subject">Square API implementation</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 5, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">Giving pledge</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 5, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">SpaceX's new rocket engine</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 5, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
</div>
</section>
</div>
<div class="col-md-3">
<section class="todo__col todo--work">
<div class="col__heading">
<h1>
<span>Work (4)</span>
<a href="#">
<i class="material-icons">more_vert</i>
</a>
</h1>
</div>
<div class="col__feed">
<div class="todo__item">
<h2 class="item__subject">Successful product test</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 5, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">New design concept</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 6, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">Meeting with investors</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 8, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">Delay of project X beta test</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 11, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
</div>
</section>
</div>
<div class="col-md-3">
<section class="todo__col todo--personal">
<div class="col__heading">
<h1>
<span>Personal (4)</span>
<a href="#">
<i class="material-icons">more_vert</i>
</a>
</h1>
</div>
<div class="col__feed">
<div class="todo__item">
<h2 class="item__subject">Dinner</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 5, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">Headquarters reconstruction</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 7, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">Invitation to EUConf</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 7, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">Dribbble invite waiting</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 11, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#" title="Mark as done">
<i class="material-icons">check</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
</div>
</section>
</div>
<div class="col-md-3">
<section class="todo__col todo--done">
<div class="col__heading">
<h1>
<span>Done (3)</span>
<a href="#">
<i class="material-icons">more_vert</i>
</a>
</h1>
</div>
<div class="col__feed">
<div class="todo__item">
<h2 class="item__subject">Write blog post</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 5, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#">
<i class="material-icons">clear</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">Design to-do dashboard</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 4, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#">
<i class="material-icons">clear</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
<div class="todo__item">
<h2 class="item__subject">Advice for young designer</h2>
<div class="item__meta">
<p>
<i class="material-icons">access_time</i>
<span class="meta__time">Aug 3, 2016</span>
</p>
</div>
<p class="item__slug">Lorem ipsum dolor sit amet, consectetur adipisicing elit culpa obcaecati.<p>
<ul class="item__actions">
<li>
<a href="#">
<i class="material-icons">clear</i>
</a>
</li>
<li>
<a href="#" title="Edit task">
<i class="material-icons">mode_edit</i>
</a>
</li>
<li>
<a href="#" title="Archive task">
<i class="material-icons">archive</i>
</a>
</li>
<li>
<a href="#" title="Delete task">
<i class="material-icons">delete</i>
</a>
</li>
</ul>
</div>
</div>
</section>
</div>
</div>
<a href="#" class="btn app__btn"><i class="material-icons">add</i></a>
</div>
</main>
// Colors
$color-blue-light: #00b0ff;
$color-grey-dark: #eee;
$color-grey-light: #f7f7f7;
$color-teal: #00bfa5;
// Functions
@function remy($value, $base: 16px) {
@return ($value / $base) * 1rem;
}
// Mixins
@mixin transition($prop: all, $duration: .2s, $timing: cubic-bezier(.4, 0, 1, 1)) {
transition: $prop $duration $timing;
}
// Variables
$radius: 2px;
$shadow-1: 0 2px 5px 0 rgba(0,0,0,.09), 0 2px 10px 0 rgba(0,0,0,.08);
$shadow-2: 0 8px 17px 0 rgba(0,0,0,.2), 0 6px 20px 0 rgba(0,0,0,.19);
$shadow-3: 0 12px 15px 0 rgba(0,0,0,.24), 0 17px 50px 0 rgba(0,0,0,.19);
// Base
body {
padding: 0;
margin: 0;
background: $color-grey-dark;
}
h1 {
margin-bottom: 1.2rem;
font-size: .95rem;
font-weight: 600;
}
h2 {
font-size: 1rem;
}
p {
margin: 0;
}
a {
@include transition;
&:focus,
&:hover {
text-decoration: none;
}
}
ul {
display: flex;
padding: 0;
margin: 0;
list-style-type: none;
}
.app__header {
padding-top: 1.25rem;
padding-bottom: 1rem;
background: #fff;
box-shadow: $shadow-1;
}
.app__nav {
justify-content: space-between;
width: 100%;
a {
vertical-align: middle;
color: #212121;
&:focus,
&:hover {
color: $color-blue-light;
}
}
i {
font-size: 1.75rem;
}
}
.app__nav .app__logo {
color: $color-blue-light;
}
.nav__user {
font-weight: 700;
color: #212121;
img {
position: relative;
top: -2px;
margin-right: 10px;
max-width: 25px;
border-radius: 50%;
}
}
.app__body {
padding-top: 1rem;
}
.todo__col {
padding: 1rem;
background: $color-grey-light;
border-radius: $radius;
box-shadow: $shadow-1;
}
.todo--mit h1 span {
color: #ff3d00;
}
.todo--work h1 span {
color: #42a5f5;
}
.todo--personal h1 span {
color: #00bfa5;
}
.todo--done h1 span {
color: #263238;
}
[class^=material-] {
font-size: 1rem;
}
.col__heading {
color: #212121;
a {
position: relative;
left: 2px;
float: right;
color: inherit;
&:focus,
&:hover {
color: $color-blue-light;
}
}
i {
font-size: 1.25rem;
}
}
.todo__item {
padding: 1rem;
background: #fff;
border-radius: $radius;
box-shadow: $shadow-1;
cursor: pointer;
transform-style: preserve-3d;
@include transition;
&:focus,
&:hover {
box-shadow: $shadow-2;
transform: scale(1.035);
/*.item__subject {
color: $color-blue-light;
}*/
}
& + & {
margin-top: 1rem;
}
}
.item__meta {
color: #666;
}
.item__meta i {
position: relative;
top: 1px;
}
.meta__time {
position: relative;
top: -2px;
font-size: .85rem;
font-weight: 600;
}
.item__subject {
margin-bottom: .65rem;
font-weight: 700;
@include transition(color);
}
.item__slug {
margin-top: .25rem;
font-size: .85rem;
color: #999;
}
.item__actions {
margin-top: 1.25rem;
justify-content: space-between;
i {
font-size: 1.25rem;
color: #bbb;
transform-style: preserve-3d;
@include transition;
&:focus,
&:hover {
color: #666;
transform: scale(1.25);
}
}
}
.app__btn {
position: fixed;
bottom: 2rem;
right: 2rem;
padding: .5rem .5rem .25rem;
color: #fff;
background: $color-blue-light;
border-radius: 50%;
box-shadow: $shadow-1;
&:focus,
&:hover {
color: #fff;
background: lighter($color-blue-light, 8%);
box-shadow: $shadow-2;
transform: scale(1.05);
transform-style: preserve-3d;
}
i {
font-size: 1.5rem;
}
}
Also see: Tab Triggers