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

              
                <p>Syntax highlighting</p>
<ul>
  <li>Uses &lt;ol&gt; for line numbering
  <li>Lines of code are a &lt;li&gt;
  <ul>
    <li>Uses <code>display: table</code> to achieve soft-wrapping
    <li>Leading white space is in an &lt;i&gt; tag with <code>display: table-cell</code></li>
    <li>code after the whitespace is in a &lt;b&gt; tag with <code>display: inline-block; white-space: pre-wrap</code></li>
    </ul>
    <li>Line numbers achieved by:</li>
  <ul>
    <li>Using <code>::before</code> for line numbering</li>
    <li>Using <code>::after</code> to get rounded corners on the vertical bar between line numbers &amp; code</li>
  </ul>
</ul>

<section class="samples">
  <article class="swift-snip-snippet">
			<div class="wrapper">
				<div class="theme-clean">
					<pre><code><ol class="code" style="counter-reset: linenum 0"><li><i></i><b><span class="comment">/*</span></b></li><li><i> </i><b><span class="comment">| multi-line</span></b></li><li><i> </i><b><span class="comment">| comment, with empty lines</span></b></li><li><i><br></i><b></b></li><li><i><br></i><b></b></li><li><i> </i><b><span class="comment">| see: https://g-mark.com</span></b></li><li><i> </i><b><span class="comment">*/</span></b></li><li><i></i><b><span class="keyword">open</span> <span class="keyword">class</span> <span class="type declaration">Blah</span>: <span class="external type">NSObject</span> {</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">enum</span> <span class="type declaration">EmbedError</span>: <span class="external type">Error</span> {</b></li><li><i>        </i><b><span class="keyword">case</span> <span class="declaration">invalidUrl</span></b></li><li><i>    </i><b>}</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">override</span> <span class="keyword">init</span>() {</b></li><li><i>        </i><b><span class="keyword">super</span>&#8203;.<span class="project symbol">init</span>()</b></li><li><i>    </i><b>}</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">private</span> <span class="keyword">var</span> <span class="declaration">x</span>: <span class="external type">Int</span>?</b></li><li><i>    </i><b><span class="keyword">internal</span> <span class="keyword">let</span> <span class="declaration">y</span>: <span class="external type">Double</span> = <span class="number">123.456</span></b></li><li><i>    </i><b><span class="keyword">lazy</span> <span class="keyword">public</span> <span class="keyword">var</span> <span class="declaration">rawString1</span> = <span class="string">#</span><span class="string">&quot;</span><span class="string">\\Hello \(y) \\World</span><span class="string">&quot;</span><span class="string">#</span></b></li><li><i>    </i><b><span class="keyword">internal</span> <span class="keyword">lazy</span> <span class="keyword">var</span> <span class="declaration">rawString2</span> = <span class="string">#</span><span class="string">&quot;</span><span class="string">\\Hello \(y) \\World</span><span class="string">&quot;</span><span class="string">#</span></b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="comment">/// Handle the embed request.</span></b></li><li><i>    </i><b><span class="comment">/// - Parameter req: the request with the url to embed</span></b></li><li><i>    </i><b><span class="attribute">@discardableResult</span></b></li><li><i>    </i><b><span class="keyword">final</span> <span class="keyword">func</span> <span class="declaration">embed</span>(_ <span class="symbol">req</span>: <span class="external type">Request</span>, <span class="symbol">completion</span>: <span class="attribute">@escaping</span> (<span class="external type">Int</span>) -&gt; <span class="external type">Void</span>) <span class="keyword">throws</span> -&gt; <span class="comment">/* Int */</span> <span class="external type">String</span> {</b></li><li><i>        </i><b><span class="keyword">guard</span> <span class="keyword">let</span> <span class="symbol">uri</span> = <span class="symbol">req</span>&#8203;.<span class="project symbol">query</span>[<span class="external type">String</span>&#8203;.<span class="keyword">self</span>, <span class="symbol">at</span>: <span class="string">&quot;</span><span class="string">url</span><span class="string">&quot;</span>], !<span class="symbol">uri</span>&#8203;.<span class="project symbol">isEmpty</span>,</b></li><li><i>            </i><b><span class="keyword">let</span> <span class="symbol">url</span> = <span class="external type">URL</span>(<span class="symbol">string</span>: <span class="symbol">uri</span>),</b></li><li><i>            </i><b><span class="keyword">let</span> <span class="symbol">components</span> = <span class="external type">URLComponents</span>(<span class="symbol">url</span>: <span class="symbol">url</span>, <span class="symbol">resolvingAgainstBaseURL</span>: <span class="keyword">false</span>),</b></li><li><i>            </i><b>(<span class="symbol">components</span>&#8203;.<span class="project symbol">scheme</span> <span class="number">==</span> <span class="string">&quot;</span><span class="string">http</span><span class="string">&quot;</span> <span class="number">||</span> <span class="symbol">components</span>&#8203;.<span class="project symbol">scheme</span> <span class="number">==</span> <span class="string">&quot;</span><span class="string">https</span><span class="string">&quot;</span>) <span class="keyword">else</span> {</b></li><li><i>                </i><b><span class="keyword">return</span> <span class="string">&quot;</span><span class="string">invalid url</span><span class="string">&quot;</span></b></li><li><i>        </i><b>}</b></li><li><i>        </i><b><span class="preprocessor">#if</span> <span class="preprocessor">swift</span>(&gt;=<span class="number">4.2</span>)</b></li><li><i>            </i><b><span class="comment">// swift 4.2 only code here</span></b></li><li><i>        </i><b><span class="preprocessor">#elseif</span> <span class="preprocessor">swift</span>(&gt;=<span class="number">3.2</span>)</b></li><li><i>            </i><b><span class="preprocessor">#warning</span>(<span class="string">&quot;</span><span class="string">message</span><span class="string">&quot;</span>)</b></li><li><i>            </i><b><span class="preprocessor">#error</span>(<span class="string">&quot;</span><span class="string">message</span><span class="string">&quot;</span>)</b></li><li><i>        </i><b><span class="preprocessor">#endif</span></b></li><li><i><br></i><b></b></li><li><i>        </i><b><span class="keyword">return</span> <span class="string">&quot;</span><span class="string">embed: \\(url)</span><span class="string">&quot;</span></b></li><li><i>    </i><b>}</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">func</span> <span class="declaration">foo</span>(<span class="symbol">these</span> <span class="symbol">numbers</span>: <span class="external type">Int</span>...) { }</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">struct</span> <span class="type declaration">Donut</span> {</b></li><li><i>        </i><b><span class="keyword">var</span> <span class="declaration">a</span>: <span class="external type">String</span></b></li><li><i>        </i><b><span class="keyword">mutating</span> <span class="keyword">func</span> <span class="declaration">boo</span>() { <span class="symbol">a</span> = <span class="string">&quot;</span><span class="string">a</span><span class="string">&quot;</span> }</b></li><li><i>    </i><b>}</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="comment">// MARK: - this is the end</span></b></li><li><i></i><b>}</b></li><li><i><br></i><b></b></li><li><i></i><b><span class="keyword">private</span> <span class="keyword">let</span> <span class="declaration">sampleCode</span> =</b></li><li><i>    </i><b><span class="string">&quot;&quot;&quot;</span><span class="string"></span></b></li><li><i>    </i><b><span class="string">func test() {</span></b></li><li><i>        </i><b><span class="string">print(&quot;This is a test.&quot;)</span></b></li><li><i>    </i><b><span class="string">}</span></b></li><li><i></i><b><span class="string">    </span><span class="string">&quot;&quot;&quot;</span></b></li><li><i><br></i><b></b></li><li><i><br></i><b></b></li><li><i></i><b><span class="keyword">private</span> <span class="keyword">let</span> <span class="declaration">anotherSample</span> = <span class="string">&quot;&quot;&quot;</span><span class="string"></span></b></li><li><i>    </i><b><span class="string">func test() {</span></b></li><li><i>        </i><b><span class="string">print(&quot;This is a </span>\((<span class="number">0</span><span class="number">..&lt;</span><span class="number">3</span>)&#8203;.<span class="project symbol">map</span>(<span class="external type">String</span>&#8203;.<span class="project symbol">init</span>)&#8203;.<span class="project symbol">joined</span>(<span class="symbol">separator</span>: <span class="string">&quot;</span><span class="string">.</span><span class="string">&quot;</span>))<span class="string">.&quot;)</span></b></li><li><i></i><b><span class="string"></span></b></li><li><i>        </i><b><span class="string">// empty line above - but this one is extra long so that I can test word-wrapping in a multiline string.</span></b></li><li><i>    </i><b><span class="string">}</span></b></li><li><i></i><b><span class="string">    </span><span class="string">&quot;&quot;&quot;</span></b></li><li><i><br></i><b></b></li><li><i></i><b><span class="attribute">@propertyWrapper</span></b></li><li><i></i><b><span class="keyword">struct</span> <span class="type declaration">Bloated</span>&lt;<span class="external type">T</span>&gt; {</b></li><li><i>    </i><b><span class="keyword">var</span> <span class="declaration">wrappedValue</span>: <span class="external type">T</span></b></li><li><i>    </i><b><span class="keyword">let</span> <span class="declaration">projectedValue</span>: <span class="external type">T</span></b></li><li><i>    </i><b><span class="keyword">init</span>(<span class="symbol">wrappedValue</span>: <span class="external type">T</span>) {</b></li><li><i>        </i><b><span class="keyword">self</span>&#8203;.<span class="project symbol">wrappedValue</span> = <span class="symbol">wrappedValue</span></b></li><li><i>        </i><b><span class="keyword">self</span>&#8203;.<span class="project symbol">projectedValue</span> = <span class="symbol">wrappedValue</span></b></li><li><i>    </i><b>}</b></li><li><i></i><b>}</b></li><li><i><br></i><b></b></li><li><i></i><b><span class="keyword">struct</span> <span class="type declaration">Bling</span> {</b></li><li><i>    </i><b>@<span class="project type">Bloated</span> <span class="keyword">var</span> <span class="declaration">zed</span> = <span class="number">42</span></b></li><li><i>    </i><b><span class="keyword">func</span> <span class="declaration">exposed</span>() {</b></li><li><i>        </i><b><span class="keyword">let</span> <span class="symbol">temp</span> = <span class="symbol">$zed</span></b></li><li><i>    </i><b>}</b></li><li><i>    </i><b><span class="keyword">func</span> <span class="declaration">`func`</span>() {</b></li><li><i>    </i><b>}</b></li><li><i></i><b>}</b></li></ol></code></pre>
				</div>
			</div>
		</article>


  <article class="swift-snip-snippet">
			<div class="wrapper">
				<div class="theme-dark">
					<pre><code><ol class="code" style="counter-reset: linenum 0"><li><i></i><b><span class="comment">/*</span></b></li><li><i> </i><b><span class="comment">| multi-line</span></b></li><li><i> </i><b><span class="comment">| comment, with empty lines</span></b></li><li><i><br></i><b></b></li><li><i><br></i><b></b></li><li><i> </i><b><span class="comment">| see: https://g-mark.com</span></b></li><li><i> </i><b><span class="comment">*/</span></b></li><li><i></i><b><span class="keyword">open</span> <span class="keyword">class</span> <span class="type declaration">Blah</span>: <span class="external type">NSObject</span> {</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">enum</span> <span class="type declaration">EmbedError</span>: <span class="external type">Error</span> {</b></li><li><i>        </i><b><span class="keyword">case</span> <span class="declaration">invalidUrl</span></b></li><li><i>    </i><b>}</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">override</span> <span class="keyword">init</span>() {</b></li><li><i>        </i><b><span class="keyword">super</span>&#8203;.<span class="project symbol">init</span>()</b></li><li><i>    </i><b>}</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">private</span> <span class="keyword">var</span> <span class="declaration">x</span>: <span class="external type">Int</span>?</b></li><li><i>    </i><b><span class="keyword">internal</span> <span class="keyword">let</span> <span class="declaration">y</span>: <span class="external type">Double</span> = <span class="number">123.456</span></b></li><li><i>    </i><b><span class="keyword">lazy</span> <span class="keyword">public</span> <span class="keyword">var</span> <span class="declaration">rawString1</span> = <span class="string">#</span><span class="string">&quot;</span><span class="string">\\Hello \(y) \\World</span><span class="string">&quot;</span><span class="string">#</span></b></li><li><i>    </i><b><span class="keyword">internal</span> <span class="keyword">lazy</span> <span class="keyword">var</span> <span class="declaration">rawString2</span> = <span class="string">#</span><span class="string">&quot;</span><span class="string">\\Hello \(y) \\World</span><span class="string">&quot;</span><span class="string">#</span></b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="comment">/// Handle the embed request.</span></b></li><li><i>    </i><b><span class="comment">/// - Parameter req: the request with the url to embed</span></b></li><li><i>    </i><b><span class="attribute">@discardableResult</span></b></li><li><i>    </i><b><span class="keyword">final</span> <span class="keyword">func</span> <span class="declaration">embed</span>(_ <span class="symbol">req</span>: <span class="external type">Request</span>, <span class="symbol">completion</span>: <span class="attribute">@escaping</span> (<span class="external type">Int</span>) -&gt; <span class="external type">Void</span>) <span class="keyword">throws</span> -&gt; <span class="comment">/* Int */</span> <span class="external type">String</span> {</b></li><li><i>        </i><b><span class="keyword">guard</span> <span class="keyword">let</span> <span class="symbol">uri</span> = <span class="symbol">req</span>&#8203;.<span class="project symbol">query</span>[<span class="external type">String</span>&#8203;.<span class="keyword">self</span>, <span class="symbol">at</span>: <span class="string">&quot;</span><span class="string">url</span><span class="string">&quot;</span>], !<span class="symbol">uri</span>&#8203;.<span class="project symbol">isEmpty</span>,</b></li><li><i>            </i><b><span class="keyword">let</span> <span class="symbol">url</span> = <span class="external type">URL</span>(<span class="symbol">string</span>: <span class="symbol">uri</span>),</b></li><li><i>            </i><b><span class="keyword">let</span> <span class="symbol">components</span> = <span class="external type">URLComponents</span>(<span class="symbol">url</span>: <span class="symbol">url</span>, <span class="symbol">resolvingAgainstBaseURL</span>: <span class="keyword">false</span>),</b></li><li><i>            </i><b>(<span class="symbol">components</span>&#8203;.<span class="project symbol">scheme</span> <span class="number">==</span> <span class="string">&quot;</span><span class="string">http</span><span class="string">&quot;</span> <span class="number">||</span> <span class="symbol">components</span>&#8203;.<span class="project symbol">scheme</span> <span class="number">==</span> <span class="string">&quot;</span><span class="string">https</span><span class="string">&quot;</span>) <span class="keyword">else</span> {</b></li><li><i>                </i><b><span class="keyword">return</span> <span class="string">&quot;</span><span class="string">invalid url</span><span class="string">&quot;</span></b></li><li><i>        </i><b>}</b></li><li><i>        </i><b><span class="preprocessor">#if</span> <span class="preprocessor">swift</span>(&gt;=<span class="number">4.2</span>)</b></li><li><i>            </i><b><span class="comment">// swift 4.2 only code here</span></b></li><li><i>        </i><b><span class="preprocessor">#elseif</span> <span class="preprocessor">swift</span>(&gt;=<span class="number">3.2</span>)</b></li><li><i>            </i><b><span class="preprocessor">#warning</span>(<span class="string">&quot;</span><span class="string">message</span><span class="string">&quot;</span>)</b></li><li><i>            </i><b><span class="preprocessor">#error</span>(<span class="string">&quot;</span><span class="string">message</span><span class="string">&quot;</span>)</b></li><li><i>        </i><b><span class="preprocessor">#endif</span></b></li><li><i><br></i><b></b></li><li><i>        </i><b><span class="keyword">return</span> <span class="string">&quot;</span><span class="string">embed: \\(url)</span><span class="string">&quot;</span></b></li><li><i>    </i><b>}</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">func</span> <span class="declaration">foo</span>(<span class="symbol">these</span> <span class="symbol">numbers</span>: <span class="external type">Int</span>...) { }</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="keyword">struct</span> <span class="type declaration">Donut</span> {</b></li><li><i>        </i><b><span class="keyword">var</span> <span class="declaration">a</span>: <span class="external type">String</span></b></li><li><i>        </i><b><span class="keyword">mutating</span> <span class="keyword">func</span> <span class="declaration">boo</span>() { <span class="symbol">a</span> = <span class="string">&quot;</span><span class="string">a</span><span class="string">&quot;</span> }</b></li><li><i>    </i><b>}</b></li><li><i><br></i><b></b></li><li><i>    </i><b><span class="comment">// MARK: - this is the end</span></b></li><li><i></i><b>}</b></li><li><i><br></i><b></b></li><li><i></i><b><span class="keyword">private</span> <span class="keyword">let</span> <span class="declaration">sampleCode</span> =</b></li><li><i>    </i><b><span class="string">&quot;&quot;&quot;</span><span class="string"></span></b></li><li><i>    </i><b><span class="string">func test() {</span></b></li><li><i>        </i><b><span class="string">print(&quot;This is a test.&quot;)</span></b></li><li><i>    </i><b><span class="string">}</span></b></li><li><i></i><b><span class="string">    </span><span class="string">&quot;&quot;&quot;</span></b></li><li><i><br></i><b></b></li><li><i><br></i><b></b></li><li><i></i><b><span class="keyword">private</span> <span class="keyword">let</span> <span class="declaration">anotherSample</span> = <span class="string">&quot;&quot;&quot;</span><span class="string"></span></b></li><li><i>    </i><b><span class="string">func test() {</span></b></li><li><i>        </i><b><span class="string">print(&quot;This is a </span>\((<span class="number">0</span><span class="number">..&lt;</span><span class="number">3</span>)&#8203;.<span class="project symbol">map</span>(<span class="external type">String</span>&#8203;.<span class="project symbol">init</span>)&#8203;.<span class="project symbol">joined</span>(<span class="symbol">separator</span>: <span class="string">&quot;</span><span class="string">.</span><span class="string">&quot;</span>))<span class="string">.&quot;)</span></b></li><li><i></i><b><span class="string"></span></b></li><li><i>        </i><b><span class="string">// empty line above - but this one is extra long so that I can test word-wrapping in a multiline string.</span></b></li><li><i>    </i><b><span class="string">}</span></b></li><li><i></i><b><span class="string">    </span><span class="string">&quot;&quot;&quot;</span></b></li><li><i><br></i><b></b></li><li><i></i><b><span class="attribute">@propertyWrapper</span></b></li><li><i></i><b><span class="keyword">struct</span> <span class="type declaration">Bloated</span>&lt;<span class="external type">T</span>&gt; {</b></li><li><i>    </i><b><span class="keyword">var</span> <span class="declaration">wrappedValue</span>: <span class="external type">T</span></b></li><li><i>    </i><b><span class="keyword">let</span> <span class="declaration">projectedValue</span>: <span class="external type">T</span></b></li><li><i>    </i><b><span class="keyword">init</span>(<span class="symbol">wrappedValue</span>: <span class="external type">T</span>) {</b></li><li><i>        </i><b><span class="keyword">self</span>&#8203;.<span class="project symbol">wrappedValue</span> = <span class="symbol">wrappedValue</span></b></li><li><i>        </i><b><span class="keyword">self</span>&#8203;.<span class="project symbol">projectedValue</span> = <span class="symbol">wrappedValue</span></b></li><li><i>    </i><b>}</b></li><li><i></i><b>}</b></li><li><i><br></i><b></b></li><li><i></i><b><span class="keyword">struct</span> <span class="type declaration">Bling</span> {</b></li><li><i>    </i><b>@<span class="project type">Bloated</span> <span class="keyword">var</span> <span class="declaration">zed</span> = <span class="number">42</span></b></li><li><i>    </i><b><span class="keyword">func</span> <span class="declaration">exposed</span>() {</b></li><li><i>        </i><b><span class="keyword">let</span> <span class="symbol">temp</span> = <span class="symbol">$zed</span></b></li><li><i>    </i><b>}</b></li><li><i>    </i><b><span class="keyword">func</span> <span class="declaration">`func`</span>() {</b></li><li><i>    </i><b>}</b></li><li><i></i><b>}</b></li></ol></code></pre>
				</div>
			</div>
		</article>
</section>
              
            
!

CSS

              
                /*
 * Use: https://www.sassmeister.com/
 *
 * Minify here: https://cssminifier.com/
 *
 */
body {
  background-color: #111;
}
body {
  color: #fff;
}
.samples {
  display: flex;
  
  article {
    margin: 1em;
  }
}

.swift-snip-snippet {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  
  * {
    display: default;
    padding: 0;
    margin: 0;
    border: none;
    box-sizing: border-box;
    font-size: 1em;
    font-weight: normal;
    font-style: normal;
    font-family: 'SF Mono', Consolas, 'Andale Mono', Monaco, Menlo, 'Ubuntu Mono', monospace;
  }
  
  .wrapper {
    overflow-x: auto;
    font-size: 0.9em;
  }
  
  ol.code {
    counter-reset: linenum;
    list-style: none;
    margin: 0 1em 0 2em;
    padding: .5em 0;
    
    @media (max-width: 768px) {
      font-size: .9em;
    }
    
    @media (max-width: 600px) {
      font-size: .8em;
    }
    
    li {
      display: table;
      counter-increment: linenum;
      position: relative;
      padding-left: 1.5em;
      
      &::before {
        user-select: none;
        -moz-user-select: none;
        -webkit-user-select: none;
        content: counter(linenum);
        position: absolute;
        right: 100%;
        width: 2em;
        padding-top: .1em;
        top: 0;
        bottom: 0;
        text-align: right;
      }
      
      i, b {
        vertical-align: top;
        position: relative;
      }
      
      i {
        display: table-cell;
        white-space: pre;
      }
      
      b {
        display: inline-block;
        white-space: pre-wrap;
        padding-left: 2.35em;
        text-indent: -2.35em;
      }
      
    }
  }
  
}

.swift-snip-snippet .theme-dark {
  
  background-color: #292A2F;
  
  ol.code {

    * {
      font-family: 'SF Mono', Consolas, 'Andale Mono', Monaco, Menlo, 'Ubuntu Mono', monospace;
    }

    .keyword,
    .attribute {
        font-weight: 500;
    }

    li {
      color: #fff;
    }

    li,
    li i,
    li b {
      line-height: 1.35em;
      min-height: 1.35em;
    }

    li::before {
      font-size: 0.8em;
      color: #898A8A;

      right: calc(100% - 7.5px);
      width: calc(2em + 7.5px);

      padding-top: .2em;
      padding-right: 7.5px;
    }
    li:first-child::before {
      margin-top: -.5em;
      padding-top: .7em;
    }
    li:last-child::before {
      margin-bottom: -.5em;
    }

    li::after {
      font-weight: normal;
      content: "";
      display: block;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 5px;
      width: 5px;
      background-color: #464544;//#636262;//#898A8A;
    }
    li:first-child::after {
      border-radius: 3px 3px 0 0;
    }
    li:last-child::after {
      border-radius: 0 0 3px 3px;
      margin-bottom: -3px;
    }

    /* keywords - e.g. func, class, private, etc. */
    .keyword {
      color: #FF68AF;
    }

    /* attributes - e.g. @objc */
    .attribute {
      color: #FF68AF;
    }

    /* function declarations */
    .declaration {
      color: #4EB0CC;
    }
    /* type declarations - i.e. class, struct, enum, protocol, and typealias names */
    .declaration.type {
      color: #6CE0FF;
    }

    /* symbols i.e. funcs & vars */
    .symbol {
    }
    .symbol.project {
      color: #78C2B3;
    }
    .symbol.external {
      color: #B281EA;
    }

    /* types - i.e. class, struct, enum, protocol, and typealias names */
    .type {
      color: #AAF2E4;
    }
    .type.project {
      color: #AAF2E4;
    }
    .type.external {
      color: #DABAFF;
    }

    /* number literals */
    .number {
      color: #D8C97B;
    }

    /* string literals */
    .string {
      color: #FF816F;
    }

    /* comments */
    .comment {
      color: #7E8C98;
    }

    /* pre-propcessor */
    .preprocessor {
      color: #FFA24F;
    }

  }

}

.swift-snip-snippet .theme-clean {
    
    background-color: #fff;
    
    ol.code {
        
        * {
            font-family: 'SF Mono', Consolas, 'Andale Mono', Monaco, Menlo, 'Ubuntu Mono', monospace;
        }
        
        .keyword,
        .attribute {
            font-weight: 500;
        }
        
        li {
            color: #000;
        }
        
        li,
        li i,
        li b {
            line-height: 1.35em;
            min-height: 1.35em;
        }
        
        li::before {
            font-size: 0.8em;
            color: #aaa;
            
            right: calc(100% - 7.5px);
            width: calc(2em + 7.5px);
            
            padding-top: .2em;
            padding-right: 7.5px;
        }
        li:first-child::before {
            margin-top: -.5em;
            padding-top: .7em;
        }
        li:last-child::before {
            margin-bottom: -.5em;
        }
        
        li::after {
            font-weight: normal;
            content: "";
            display: block;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 5px;
            width: 5px;
            background-color: rgb(205,233,244);
        }
        li:first-child::after {
            border-radius: 3px 3px 0 0;
        }
        li:last-child::after {
            border-radius: 0 0 3px 3px;
            margin-bottom: -3px;
        }
        
        /* keywords - e.g. func, class, private, etc. */
        .keyword {
            color: #9B2393;
        }
        
        /* attributes - e.g. @objc */
        .attribute {
            color: #9B2393;
        }
        
        /* function declarations */
        .declaration {
            color: #0F68A0;
        }
        /* type declarations - i.e. class, struct, enum, protocol, and typealias names */
        .declaration.type {
            color: #0B4F79;
        }
        
        /* symbols i.e. funcs & vars */
        .symbol {
        }
        .symbol.project {
            color: #326D74;
        }
        .symbol.external {
            color: #6C36A9;
        }
        
        /* types - i.e. class, struct, enum, protocol, and typealias names */
        .type {
            color: #1C464A;
        }
        .type.project {
            color: #1C464A;
        }
        .type.external {
            color: #3900A0;
        }
        
        /* number literals */
        .number {
            color: #1C00CF;
        }
        
        /* string literals */
        .string {
            color: #C41A16;
        }
        
        /* comments */
        .comment {
            color: #5D6C79;
        }
        
        /* pre-propcessor */
        .preprocessor {
            color: #643820;
        }
        
    }
    
}

              
            
!

JS

              
                
              
            
!
999px

Console