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.
.container
// Top row
.e
.a
.s
.y
// 2nd row
.a
.circle
.s
// 3rd row
.s
.a
// 4th row
.y
.s
.a
.e
.link-container
.credit Design by
a(href='https://www.instagram.com/quincybanks/' target='_blank') Quincy Banks
| Troye Sivan's album
a(href='https://troyesivan.lnk.to/InADream' target='_blank') In A Dream
|  now streaming
// Colors
$l: #e7e7e7;
$bg: #0d0f11;
$credit: #fff;
$dreamred: #CE3C38;
$t: rgba(255,0,0,0); // transparent
// Alternative colors:
/* $bg: #F4F3EF;
$l: #1B1718; // letters
$credit: #0d0f11; */
// Notes from reference image:
// Letters E & S: h 92 px, w 82 px
// Letters A & Y: h 92 px, w 87 px
// Middle circle diameter: 199 px
// Font size can be modified to adjust artwork scale
html {
font-size: 14px;
background: $bg;
}
@media (max-width: 320px) {
html { font-size: 6px; }
.link-container { font-size: 12px; }
}
@media (min-width: 321px) {
html { font-size: 6px; }
.link-container { font-size: 12px; }
}
@media (min-width: 480px) {
html { font-size: 10px; }
.link-container { font-size: 12px; }
}
@media (min-width: 640px) { html { font-size: 12px; } }
@media (min-width: 768px) { html { font-size: 12px; } }
@media (min-width: 1024px) { html { font-size: 13px; } }
@media (min-width: 1280px) { html { font-size: 14px; } }
@media (min-width: 1920px) { html { font-size: 16px; } }
@media (min-width: 2200px) { html { font-size: 18px; } }
.container {
display: grid;
grid-template-rows: repeat(4, 9.2rem);
grid-template-columns: repeat(4, 8.7rem);
grid-column-gap: 1.56rem;
grid-row-gap: 1rem; // Actually should be 0.9rem
align-items: center;
// border: 1px solid black;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -55%);
}
// Bring font from
@font-face {
font-family: 'plateletthin';
src: url(https://dvfnvgxhycwzf.cloudfront.net/media/ShopDesignSplit4-shopStylesheet/value/.fqmsTnPX/ShopDesignSplit4-shopStylesheet-16594.woff) format('woff');
font-weight: normal;
font-style: normal;
}
.link-container {
.credit {
margin-bottom: 0.5rem;
}
position: fixed;
bottom: 0;
margin: auto;
width: 100%;
text-align: center;
padding: 1rem;
margin-bottom: 1rem;
font-size: 1.5rem;
font-weight: 400;
color: $credit;
font-family: 'plateletthin', sans-serif;
a {
color: $dreamred;
font-weight: 600;
text-decoration: none;
}
a:hover, a:focus {
text-decoration: underline;
font-weight: 900;
color: darken($dreamred, 20%);
}
}
.circle {
height: 19.6rem;
width: 19.6rem;
background: $l;
display: inline-block;
border-radius: 50%;
grid-column: 2 / 4;
grid-row: 2 / 4;
}
.e, .s {
height: 9.2rem;
width: 8.3rem;
}
.a, .y {
// TODO: Adjust heights
height: 9.2rem;
width: 8.7rem;
}
.e {
background:
linear-gradient(32deg, $t 34%, $l 35%, $l 63%, $t 64%) 1.4rem 3.2rem / 6.2rem 2.2rem, // middle line
radial-gradient(100% 100% at 50% 50%, $bg 50%, $t 51%) 98% 3.66rem / 2.5rem 2.5rem, // inside of top arch
linear-gradient(32deg, $t 49%, $l 50%, $l 71%, $t 72%) 1.4rem 0rem / 5.9rem 3.5rem, // top diagonal line
linear-gradient(32deg, $bg 73%, $t 74%) 4.3rem 2.1rem / 3.2rem 4.2rem, // cover part of top arch
radial-gradient(100% 100% at 50% 50%, $l 50%, $bg 51%) 100% 1.85rem / 3.8rem 4.4rem, // top arch
// Bottom line
radial-gradient(100% 100% at 50% 50%, $bg 50%, $t 51%) 99% 6rem / 2.2rem 2.2rem, // inside of bottom arch
linear-gradient(32deg, $t 41%, $l 41.5%, $l 60.5%, $t 61%) 0 4.8rem / 6.8rem 9.2rem-4.8rem, // bottom diagonal line
linear-gradient($bg, $bg 100%) 5.4rem 6.9rem / 1.4rem 1.2rem, // cover part of bottom arch
radial-gradient(100% 200% at 50% 0%, $l 50%, $t 51%) 97.5% 101% / 3.7rem 1.9rem, // bottom arch
linear-gradient($l, $l 100%) 0 0 / 1.4rem 5.6rem; // vertical line
background-repeat: no-repeat;
}
.a {
background:
// The first one will show up on the top
linear-gradient(32deg, $t 34%, $l 35%, $l 61%, $t 62%) 1.4rem 3.2rem / 6.2rem 2.2rem, // middle line
// Right arch
radial-gradient(200% 200% at 0% 100%, $bg 56%, $t 57%) 6.079rem 3.4rem / 1.2rem 1.375rem, // inside of right arch
radial-gradient(200% 215% at 0% 100%, $t 7%, $l 8%, $l 49%, $t 50%) 101.5% 2.1rem / 1.9rem 1.9rem, // right arch
linear-gradient($bg, $bg 100%) 100% 0% / 0.8rem 4rem, // hide part of top line
linear-gradient(32deg, $t 39%, $l 40%, $l 60%, $t 61%) 1.4rem 0rem / 8.3rem 3.5rem, // top line
linear-gradient($l, $l 100%) 100% 100% / 1.4rem 5.5rem, // right vertical line
// Left "foot"
linear-gradient($l, $l 100%) 0 0 / 1.4rem 5.5rem, // left vertical line
linear-gradient($bg, $bg 100%) 1.41rem 3.3rem / 0.5rem 1.5rem, // cover left arch edge
linear-gradient(31deg, $t 34%, $l 35%, $l 59%, $t 60%) 0.78rem 4.86rem / 3.8rem 4.4rem, // bottom diagonal line
linear-gradient(38deg, $t 51%, $bg 52%, $bg 69%, $t 70%) 2rem 5rem / 1.5rem 3rem, // cover left arch edge
radial-gradient(100% 100% at 50% 50%, $bg 50%, $t 51%) 1.4rem 2.9rem / 3.3rem 3.3rem, // inside of left arch
radial-gradient(100% 100% at 50% 50%, $l 50%, $bg 51%) -0.05rem 3.85rem / 3.3rem 3.3rem; // left arch
background-repeat: no-repeat;
}
.s {
background:
// Middle line
linear-gradient(32deg, $t 34%, $l 34.5%, $l 52.5%, $t 53%) 0 1.8rem / 100% 3.9rem, // middle line
// Bottom line
// linear-gradient(purple, purple 100%) 0% 0% / 2.8rem 5.7rem, // placement helper
radial-gradient(100% 100% at 50% 50%, $bg 50%, $t 51%) 6.55rem 7.22rem / 1.28rem 1.28rem, // inside of bottom arch
linear-gradient(32deg, $t 50.5%, $l 51%, $l 73%, $t 74%) 0% 5.7rem / 5.5rem 3.5rem, // bottom diagonal line
linear-gradient(32deg, $t 45%, $bg 46%, $bg 71%, $t 72%) 2.4rem 5.6rem / 5.1rem 2.7rem, // cover part of bottom arch
radial-gradient(100% 100% at 50% 50%, $l 50%, $t 51%) 99% 100% / 4.07rem 4.07rem, // bottom arch,
// Top line
radial-gradient(100% 100% at 50% 50%, $bg 50%, $t 51%) 98% 3.66rem / 2.5rem 2.5rem, // inside of top arch
linear-gradient(32deg, $t 49%, $l 50%, $l 71%, $t 72%) 1.4rem 0rem / 5.9rem 3.5rem, // top diagonal line
linear-gradient(32deg, $bg 73%, $t 74%) 4.3rem 2.1rem / 3.2rem 4.2rem, // cover part of top arch
radial-gradient(100% 100% at 50% 50%, $l 50%, $bg 51%) 100% 1.8rem / 3.8rem 4.4rem, // top arch
linear-gradient($l, $l 100%) 0% 0% / 1.5rem 2.5rem; // left vertical line
background-repeat: no-repeat;
}
// left top / width height
.y {
background:
// Top "hook"
radial-gradient(100% 100% at 50% 50%, $bg 50%, $t 51.5%) 0.55rem 0.6rem / 1.27rem 1.27rem, // inside of top arch
linear-gradient(32deg, $t 46%, $l 47%, $l 78%, $t 79%) 3.1rem 0.2rem / 1.6rem 3.6rem, // top diagonal line
linear-gradient(32deg, $t 30%, $l 31%, $l 64%, $t 65%) 1.1rem 3.7rem / 6.2rem 2.1rem, // middle diagonal line
linear-gradient(32deg, $t 15%, $l 16%, $l 45%, $bg 46%, $bg 70%, $t 71%) 0.8rem 0.7rem / 3.7rem 3.9rem, // cover part of top arch
radial-gradient(100% 100% at 50% 50%, $l 50%, $t 51.5%) 1% 0% / 4.2rem 4.2rem, // top arch,
// Bottom line
linear-gradient(32deg, $t 37%, $l 38%, $l 63%, $t 64%) 0.8rem 100% / 6.5rem 2.3rem, // bottom diagonal line
linear-gradient(32deg, $t 15%, $l 16%, $l 36%, $bg 37%, $bg 63%, $t 64%) 0.7rem 4.2rem / 4.3rem 3rem, // lengthening bottom diagonal line
radial-gradient(100% 100% at 50% 50%, $bg 51%, $t 52%) 0.2rem 3.2rem / 2rem 2rem, // tip of bottom arch
radial-gradient(100% 100% at 50% 50%, $l 50%, $t 51.5%) 0 3.1rem / 4.1rem 4.1rem, // bottom arch
// Right vertical line
linear-gradient($l, $l 100%) 100% 100% / 1.5rem 100%;
background-repeat: no-repeat;
}
// ¯\_(ツ)_/¯
Also see: Tab Triggers