Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <style>
/* Styles just for this documentation page */
  :root{
    /* Thank you modernfontstacks.com */
    font-family: ui-rounded, 'Hiragino Maru Gothic ProN', Quicksand, Comfortaa, Manjari, 'Arial Rounded MT', 'Arial Rounded MT Bold', Calibri, source-sans-pro, sans-serif;
font-weight: normal;
    font-size: 1.5rem;
    color: #222;
  }
  
  body{
    max-width: 80ch;
  }
  
  h1,h2,h3{
    border-block-end: 0.2em solid currentcolor;
    border-block-end-color: accentcolor;
  }
  
  strong{
    font-family: Superclarendon, 'Bookman Old Style', 'URW Bookman', 'URW Bookman L', 'Georgia Pro', Georgia, serif;
font-weight: bold;
  }
  
  code{
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
font-weight: bold;
  }
  
  pre>code{
    font-size: 0.75rem;
  }

</style>

<h1>Markdown CSS Framework</h1>

<p>I was inspired by an offhand comment by someone in the <a href="https://www.patreon.com/shoptalkshow" target="_blank" rel="noopener noreferrer nofollow">Shoptalk Show Discord</a> after a lengthy discussion about tailwind css. While I am not a fan of tailwind, one thing they do use quite heavily is non standard characters for custom value class names. (for example: <code>p-[12px]</code> uses <code>[]</code> characters in a class name to represent a padding of 12 pixels.) In that moment, I realized you could make a lot of the standard markdown syntax into class names that do the same thing.</p>

<p>So I did.</p>
<p>Should you use this? <strong>Not without proper semantic HTML to go along with it.</strong> It's extremely inaccessible otherwise, and you might as well use a <code>&lt;div /&gt;</code> for everything.</p>

<p>Is this a neat idea? Sure! I definitely had fun making it.</p>

<p><strong>Note:</strong> This is a very <strong>Modern</strong> CSS framework. It makes heavy use of <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting" target="_blank" rel="noopener noreferrer nofollow">CSS Nesting</a> (for nested lists specifically). </p>

<p>Anyway, enjoy the chaos.</p>

<h2>Documentation</h2>
<h3>Installation</h3>

To use this <strong>(please don't)</strong>, add the following to the head of your page:

<pre><code>&lt;link rel="stylesheet" href="https://codepen.io/fimion/pen/oNVQBRJ.css" /&gt;</code></pre>

<h3>Basics</h3>

<p class="*">Italics? No problem <code>class="*"</code></p>
<p class="**">Be Bold. <code>class="**"</code></p>
<p class="***">WHY NOT BOTH?? <code>class="***"</code></p>

<p>You can spoiler something with <code>class="||"</code>. Hover to remove spoiler: <span class="||">Surprise!</span></p>

<p> Did you make a <span class="~~">misteak</span> mistake? <code>class="~~"</code></p>

<p>we have <span class="^">superscript</span> (<code>class="^"</code>) and we have <span class="~">subscript</span> (<code>class="~"</code>)</p>

<p> you can also <span class="==">Highlight things</span> with <code>class="=="</code></p>

<p>Block quotes can be made with <code>class=">"</code></p>

<p class=">">
  This should be a block quote.
</p>

<h3>Code Blocks</h3>
<p> This word should be monospaced and inline: <span class="`">Testing</span> (<code>class="`"</code>)</p>

<p>A multiline preformatted text box can be made with <code>class="```"</code></p>
<p class="```">
  This text

  should

  preserve...

  ...whitespace
</p>

<h3>Lists</h3>

<p>Unordered lists can be made using <code>class="-"</code></p>
<p class="-">
  This is a list item?
  <span class="-">
    Test
    <span class="-">
      Nested!
    </span>
  </span>
</p>

<p>Ordered lists can be made using <code>class="1."</code> ("1." can be replaced by any number followed by a period)</p>
<p class="1.">
  Testing numbered lists
  <span class="2.">
    Inner item
    <span class="3.">
      Inner grand-item
    </span>
    <span class="10.">
      Inner grand-item
    </span>
  </span>
  <span class="6.">
    Inner item
    <span class="1.">
      Inner grand-item
    </span>
    <span class="1.">
      Inner grand-item
    </span>
  </span>
</p>
<p class="5.">Item 2</p>

<h3>Headings</h3>

<p>Headings can be made with <code>class="#"</code> to <code>class="######"</code>.</p>

<p class="#">Heading 1</p>
<p class="##">Heading 2</p>
<p class="###">Heading 3</p>
<p class="####">Heading 4</p>
<p class="#####">Heading 5</p>
<p class="######">Heading 6</p>

<h2>Can you combine them?</h2>

<p class="# > ~~ - || 1. *** ">Yes</p>



              
            
!

CSS

              
                .\* {
  font-style: italic;
}

.\*\* {
  font-weight: bold;
}

.\*\*\* {
  font-weight: bold;
  font-style: italic;
}

.\# {
  font-size: 3rem;
}

.\#\# {
  font-size: 2.5rem;
}
.\#\#\# {
  font-size: 2rem;
}
.\#\#\#\# {
  font-size: 1.5rem;
}
.\#\#\#\#\# {
  font-size: 1rem;
}
.\#\#\#\#\#\# {
  font-size: 0.75rem;
}

.\` {
  display: inline-block;
  font-family: monospace;
  white-space: pre-wrap;
  background-color: var(--pre-background-color, #f2f2f2);
  padding: 0.2em;
}

.\`\`\` {
  display: block;
  font-family: monospace;
  white-space: pre;
  background-color: var(--pre-background-color, #f2f2f2);
  padding-block: 1em;
  padding-inline: 0.5em;
}

.\> {
  display: block;
  padding-block: 0.2em;
  padding-inline-start: 1ch;
  border-inline-start: 3px solid currentcolor;
  border-inline-start-color: accentcolor;
}

.\|\| {
  position: relative;

  &::after {
    position: absolute;
    display: inline;
    content: "";
    z-index: 10;
    background-color: currentcolor;
    transition: background-color 0.2s ease-in-out;
    inset-block: 0;
    inset-inline: 0;
    width: 100%;
  }

  &:hover::after {
    background-color: transparent;
  }

  &:focus::after {
    display: none;
  }
}

.\^ {
  vertical-align: super;
  font-size: smaller;
}

.\~ {
  vertical-align: sub;
  font-size: smaller;
}

.\~\~ {
  text-decoration: line-through;
}

.\=\= {
  padding: 0.15em;
  background-color: mark;
  color: marktext;
}

.\- {
  display: list-item;
  list-style-position: outside;
  list-style-type: disc;
  margin-inline-start: 2.5rem;

  & > & {
    list-style-type: circle;

    & > & {
      list-style-type: square;
    }
  }
}

:is([class*="1."], [class*="2."], [class*="3."], [class*="4."], [class*="5."], [class*="6."], [class*="7."], [class*="8."], [class*="9."], [class*="0."]) {
  
  --counter-name: first-list;
  display: list-item;
  list-style-type: decimal;
  counter-increment: var(--counter-name, first-list);
  margin-inline-start: 2.5rem;
  
  &:first-child{
    counter-set: var(--counter-name, first-list) 1;
  }

  *:not(&) + & {
    counter-set: var(--counter-name, first-list) 1;
  }

  &::marker {
    content: counter(var(--counter-name, first-list)) ". ";
  }

  & & {
    --counter-name: second-list;
  }
  
  & & & {
    --counter-name: third-list;
  }
  
  & & & & {
    --counter-name: fourth-list;
  }
  
  & & & & & {
    --counter-name: fifth-list;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console