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.
<body>
<aside>
<h2>All notes</h2>
<section>
<article>
<img src="https://assets.codepen.io/413052/double-diamond.png">
<h3>Design process</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ut nunc pellentesque, suscipit dui vel, consequat dolor.</p>
<div>12 minutes ago</div>
</article>
<article>
<h3>Skin tool ideas</h3>
<p>Vestibulum ut nunc pellentesque, suscipit dui vel, consequat dolor.</p>
<div>Yesterday</div>
</article>
<article>
<img src="https://assets.codepen.io/413052/yosemite.jpeg">
<h3>A new set of demos for the website</h3>
<p>Donec in imperdiet orci, et malesuada mauris. Aenean euismod quis mauris eu congue. Duis vestibulum elementum varius.</p>
<div>2 days ago</div>
</article>
<article>
<h3>Usecase drafts</h3>
<p>Curabitur ultricies neque non commodo auctor. Quisque vehicula laoreet quam, ut fringilla erat molestie sed. Aenean id arcu ac nunc eleifend ultricies. Donec in imperdiet orci, et malesuada mauris. Aenean euismod quis mauris eu congue. Duis vestibulum elementum varius.</p>
<div>2 days ago</div>
</article>
<article>
<h3>Checkin meeting notes</h3>
<p>In cursus, lorem vitae finibus maximus, nunc arcu porttitor ligula, at sagittis tellus leo at sem.</p>
<div>Last week</div>
</article>
<article>
<img src="https://assets.codepen.io/413052/logo.png">
<h3>All hands</h3>
<p>Nulla viverra ipsum nec ante imperdiet sagittis. Vivamus lacinia eros ac arcu eleifend luctus. Nulla congue pulvinar diam ut elementum.</p>
<div>Last month</div>
</article>
<article>
<h3>Tinyverse Bar Design</h3>
<p>Lacinia eros ac arcu eleifend luctus. Nulla congue pulvinar diam ut elementum.</p>
<div>Last month</div>
</article>
<article>
<h3>Orientation</h3>
<p>Vivamus lacinia eros ac arcu eleifend luctus. Nulla congue pulvinar diam ut elementum.</p>
<div>Last month</div>
</article>
</section>
</aside>
<header>
<svg height="16" viewBox="0 0 15 16" width="15" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd" transform="translate(-361 -210)">
<rect fill="#56606f" height="16" opacity=".5" rx="1.5" width="11" x="361" y="210"></rect>
<rect fill="#56606f" height="16" opacity=".5" rx="1" width="2" x="374" y="210"></rect>
<path d="m373 216h-4v-3.5l-5.5 5.5 5.5 5.5v-3.5h4z" fill="#fff"></path>
</g>
</svg>
<ul class="tags">
<li>Foo</li>
<li>Bar</li>
<li>Travel</li>
</ul>
<button type="button" style="margin-left: auto;">Share</button>
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path d="m0 0h24v24h-24z" fill="#fff"></path>
<g fill="#aaafb7">
<rect height="4" rx="2" width="4" x="4" y="10"></rect>
<rect height="4" rx="2" width="4" x="10" y="10"></rect>
<rect height="4" rx="2" width="4" x="16" y="10"></rect>
</g>
</g>
</svg>
</header>
<main>
<textarea id="editor"> <h1>Product Design Process</h1>
<div class="callout">The Product Design Process takes loose ideas, uses research and testing to shape them into firm concepts, and then deliver them into valuable products and features.</div>
<h3>Todo</h3>
<ul class="tox-checklist">
<li class="tox-checklist--checked">Book meetings</li>
<li class="">Finalize documentation</li>
<li>Plan introductionary presentation</li>
</ul>
<p>At a high-level the design approach is a democratic one, encouraging ideation from all stakeholders — whether that's <span style="background-color: #fbeeb8;">decision makers, designers, engineerings or customers</span>. The process provides clear stages of stakeholder buy-in, it retains the why behind any<span style="color: #e03e2d;"> feature or product</span>, and as the backlog develops it provides a very clear roadmap of <span style="color: #e03e2d;">small, medium and long term goals.</span></p>
<h2>The double diamond</h2>
<p>The double diamond below outlines the <strong>9 key phases</strong> any idea takes on its way to our customers. A small project can fly through these stages in a matter of a days, but larger, riskier bets can take longer as we focus to validate the market value of a product before we spend the money building it.</p>
<p><em>The walls are made up of rocks</em>, mountains in size, partly separated from each other by side cañons, and they are so sheer in front, and so compactly and harmoniously arranged on a level floor, that the Valley, comprehensively seen, looks like an immense hall or temple lighted from above.</p>
<p><img src="https://assets.codepen.io/413052/double-diamond.png" alt="Double diamond illustration" /></p>
<p>But no temple made with hands can compare with Yosemite. Every rock in its walls seems to glow with life. Some lean back in majestic repose; <span style="background-color: #c2e0f4; color: #236fa1;">others, absolutely sheer or nearly so for thousands of feet, advance beyond their companions in thoughtful attitudes, giving welcome to storms and calms alike, seemingly aware, yet heedless, of everything going on about them</span>. </p>
<p>Down through the middle of the Valley flows the crystal Merced, River of Mercy, peacefully quiet, reflecting lilies and trees and the onlooking rocks;</p>
<p>Awful in stern, immovable majesty, how softly these rocks are adorned, and how fine and reassuring the company they keep: their feet among beautiful groves and meadows, their brows in the sky, a thousand flowers leaning confidingly against their feet, bathed in floods of water, floods of light, while the snow and waterfalls, the winds and avalanches and clouds shine and sing and wreathe about them as the years go by, and myriads of small winged creatures birds, bees, butterflies--give glad animation and help to make all the air into music. Down through the middle of the Valley flows the crystal Merced, River of Mercy, peacefully quiet, reflecting lilies and trees and the onlooking rocks; things frail and fleeting and types of endurance meeting here and blending in countless forms, as if into this one mountain mansion Nature had gathered her choicest treasures, to draw her lovers into close and confiding communion with her.</p>
</textarea>
</main>
</body>
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
color: #262c42;
}
main {
position: fixed;
top: 3rem;
left: calc(260px + 0rem);
right: 0rem;
bottom: 0rem;
}
aside {
position: fixed;
width: 260px;
top: 0px;
bottom: 0;
left: 0;
/* padding: 1rem; */
box-sizing: border-box;
background-color: #ecf3f6;
border-right: 1px solid rgba(0, 0, 0, 0.1);
}
aside h2 {
padding: 0.75rem 1rem;
font-size: 20px;
font-weight: 600;
}
aside article {
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
font-size: 13px;
line-height: 1.3;
padding: 0.75rem 1rem;
}
aside article:first-child {
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
aside article::after {
content: "";
clear: both;
display: table;
}
aside article h3 {
font-size: 15px;
font-weight: 600;
margin: 0 0 0.3rem;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
aside article p {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin: 0 0 0.4rem;
overflow: hidden;
}
aside article div {
font-size: 11px;
color: rgba(0, 0, 0, 0.4);
}
aside article img {
display: block;
width: 5rem;
height: 5rem;
object-fit: cover;
float: right;
margin-left: 0.5rem;
}
header {
position: fixed;
top: 0;
left: 260px;
right: 0;
height: 3rem;
display: flex;
align-items: center;
/* justify-content: flex-end; */
padding: 0 2rem;
}
header > *:not(:last-child) {
margin-right: 2rem;
}
header button {
background: #2ba0ff;
color: #fff;
border-radius: 100px;
padding: 0.5rem 1rem;
font-size: 14px;
font-weight: 500;
border: none;
outline: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-user-select: none;
}
.tags {
list-style: none;
padding: 0;
margin: 0;
display: flex;
}
.tags li {
display: block;
background-color: #eeeff1;
padding: 0.2rem 0.6rem;
margin-right: 0.2rem;
border-radius: 100px;
font-size: 12px;
font-weight: 500;
color: #aaafb7;
}
tinymce.init({
selector: "#editor",
plugins:
"codesample hr image imagetools link lists checklist",
toolbar:
"styleselect | bold italic underline strikethrough forecolor backcolor | image link codesample hr | bullist numlist checklist",
menubar: false,
statusbar: false,
skin: "snow",
icons: "thin",
height: "100%",
style_formats: [
{ title: "Title", block: "h1" },
{ title: "Heading", block: "h2" },
{ title: "Sub heading", block: "h3" },
{ title: "Paragraph", block: "p" },
{ title: "Code", inline: "code" },
{ title: "Quote", block: "blockquote" },
{ title: "Callout", block: "div", classes: "call-out" }
],
content_style: "body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; line-height: 1.4; margin: 3rem auto; max-width: 740px; } table { border-collapse: collapse; } table th, table td { border: 1px solid #ccc; padding: 0.4rem; } figure { display: table; margin: 1rem auto; } figure figcaption { color: #999; display: block; margin-top: 0.25rem; text-align: center; } hr { border-color: #ccc; border-style: solid; border-width: 1px 0 0 0; } code { background-color: #e8e8e8; border-radius: 3px; padding: 0.1rem 0.2rem; } img { max-width: 100%; } div.callout { border-radius: 4px; background-color: #f7f6f3; padding: 1rem 1rem 1rem 3rem; position: relative; } div.callout:before { content: '📣'; display: block; position: absolute; top: 1rem; left: 1rem; font-size: 20px; } .mce-content-body:not([dir=rtl]) blockquote { border-left: 2px solid #ccc; margin-left: 1.5rem; padding-left: 1rem; } .mce-content-body[dir=rtl] blockquote { border-right: 2px solid #ccc; margin-right: 1.5rem; padding-right: 1rem; }"
});
Also see: Tab Triggers