Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              
<div class="toggles">
  <button type="button" id="logical" aria-pressed="false" onclick="toggle(this.id);flipLogical();">
    Logical
  </button>
</div>

<h1>Block Quote Examples</h1>

<p>
  Used in the blog post <cite><a href="https://adrianroselli.com/2019/11/css-logical-properties.html">CSS Logical Properties</a></cite>.
</p>

<h2>English</h2>

<blockquote class="typical">
  <dl>
    <dt>Bard</dt>
    <dd><q>You two go downstairs and we’ll check up here.</q></dd>
    <dt>(new) Cleric</dt>
    <dd><q>Never split the party.</q></dd>
    <dt>Bard</dt>
    <dd><q>ALWAYS SPLIT THE PARTY! We can get more done.</q></dd>  
  </dl>
  <p>
    [ a statue starts shouting at the party ]
  </p>
  <dl>
    <dt>Bard</dt>
    <dd><q>Or we can all go downstairs.</q></dd>
  </dl>
  <footer>
    <cite>Adrian Roselli (@aardrian) <a href="https://twitter.com/aardrian/status/1167223782588723200">August 29, 2019</a></cite>
  </footer>
</blockquote>

<h2>Urdu</h2>

<p>
  All I did was feed the text strings into Google Translate, add a <code>dir</code> and <code>lang</code>, and walk away.
</p>

<blockquote class="typical" dir="rtl" lang="ur">
  <dl>
    <dt>بارڈ</dt>
    <dd><q>آپ دونوں نیچے چلے جائیں اور ہم یہاں چیک اپ کریں گے۔</q></dd>
    <dt>(نئی) مولوی</dt>
    <dd><q>کبھی پارٹی کو تقسیم نہ کریں۔</q></dd>
    <dt>بارڈ</dt>
    <dd><q>ہمیشہ پارٹی کو الگ! ہم مزید کام کر سکتے ہیں۔</q></dd>  
  </dl>
  <p>
    [ پارٹی میں ایک مجسمہ چیخنے لگا۔ ]
  </p>
  <dl>
    <dt>بارڈ</dt>
    <dd><q>یا ہم سب نیچے کی طرف جا سکتے ہیں۔</q></dd>
  </dl>
  <footer>
    <cite>Adrian Roselli (@aardrian) <a href="https://twitter.com/aardrian/status/1167223782588723200">29 اگست ، 2019۔</a></cite>
  </footer>
</blockquote>

<h2>Japanese</h2>

<p>
  All I did was feed the text strings into Google Translate, add a <code>writing-mode</code> and <code>lang</code>, and walk away.
</p>

<blockquote class="typical" style="writing-mode: vertical-lr" lang="jp">
  <dl>
    <dt>吟遊詩人</dt>
    <dd><q>2階下に行くと、ここでチェックします。</q></dd>
    <dt>(新着) クレリック</dt>
    <dd><q>パーティーを分割しないでください。</q></dd>
    <dt>吟遊詩人</dt>
    <dd><q>常にパーティーを分割します! さらに多くのことができます。</q></dd>  
  </dl>
  <p>
    [パーティーで彫像が叫び始める]
  </p>
  <dl>
    <dt>吟遊詩人</dt>
    <dd><q>または、私たちはすべて階下に行くことができます。</q></dd>
  </dl>
  <footer>
    <cite>Adrian Roselli (@aardrian) <a href="https://twitter.com/aardrian/status/1167223782588723200">2019年8月29日</a></cite>
  </footer>
</blockquote>

<h2>Chinese</h2>

<p>
  All I did was feed the text strings into Google Translate, add a <code>writing-mode</code> and <code>lang</code>, and walk away.
</p>

<blockquote class="typical" style="writing-mode: vertical-rl" lang="zh">
  <dl>
    <dt>诗人</dt>
    <dd><q>你们两个下楼,我们将在这里查看。</q></dd>
    <dt>(新) 牧师</dt>
    <dd><q>永远不要分开派对。</q></dd>
    <dt>诗人</dt>
    <dd><q>总是分裂党! 我们可以做得更多。</q></dd>  
  </dl>
  <p>
    [ 一个雕像开始在聚会上大喊大叫 ]
  </p>
  <dl>
    <dt>诗人</dt>
    <dd><q>或者我们都可以下楼了。</q></dd>
  </dl>
  <footer>
    <cite>Adrian Roselli (@aardrian) <a href="https://twitter.com/aardrian/status/1167223782588723200">2019年8月29日</a></cite>
  </footer>
</blockquote>

<p>
  Used in the blog post <cite><a href="https://adrianroselli.com/">CSS Logical Properties</a></cite>.
</p>
            
          
!
            
              body {
  background-color: #fff;
  color: #333;
  margin: 5em 2em 5em 2em;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.5;
/*     line-height: 1.5; */
/*     letter-spacing: 0.12em; */
/*     word-spacing: 0.16em; */
/*     font-size: 200%; */
}

code {
  font-family: "Lucida Console", monospace;
  color: #060;
}




blockquote {
/*  very much breaking the rules here,  */
/*  so this will not work at all  */
/*  https://drafts.csswg.org/css-logical/#logical-shorthand-keyword  */
  background-image: logical radial-gradient(circle at block-start inline-start, #ff0 0, #fff 50%);  
}

blockquote dt {
  font-weight: bold;
}

blockquote p {
  font-style: italic;
  text-align: center;
}

blockquote dt::after {
  content: ":";
}

blockquote cite::before {
  content: "— ";
}

/* Styles we use today */

blockquote.typical {
  max-width: 27em;
  margin: 2em auto;
  border-top: .2em solid #ccc;
  border-left: .2em solid #ccc;
  border-top-left-radius: 2em;
  padding-top: .5em;
}

blockquote.typical > *:not(footer) {
  margin: .5em 1em;
}

blockquote.typical footer {
  text-align: right;
  margin-top: 1.5em;
  border-top: .05em solid #ccc;
  padding-top: 1em;
  padding-right: 1em;
}

blockquote.typical p {
  margin: 1em auto;
}

blockquote.typical dt {
  margin-top: .5em;
}

blockquote.typical dd {
  margin-left: 1em;
}

/* New logical styles */

blockquote.logical {
  max-inline-size: 27em;
  margin-block: 2em;
  margin-inline: auto;
  border-block-start: .2em solid #ccc;
  border-inline-start: .2em solid #ccc;
  border-start-start-radius: 2em;
  padding-block-start: .5em;
}

blockquote.logical > *:not(footer) {
  margin-block: .5em;
  margin-inline: 1em;
}

blockquote.logical footer {
  text-align: end;
  margin-block-start: 1.5em;
  border-block-start: .05em solid #ccc;
  padding-block-start: 1em;
  padding-inline-end: 1em;
}

blockquote.logical p {
  margin-block: 1em;
  margin-inline: auto;
}

blockquote.logical dt {
  margin-block-start: .5em;
}

blockquote.logical dd {
  margin-inline-start: 1em;
}


/* Toggle */
/* https://adrianroselli.com/2019/08/under-engineered-toggles-too.html */

.toggles {
  margin: 0;
  padding: .5em 2em;
  border-bottom: .1em solid #ccc;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #fff;
}

.toggles [aria-pressed] {
  display: block;
  box-sizing: border-box;
  border: none;
  color: inherit;
  background: none;
  font: inherit;
  line-height: inherit;
  text-align: left;
  padding: .4em 0 .4em 4em;
  position: relative;
}

.toggles [aria-pressed][disabled],
.toggles [aria-pressed][disabled]:hover {
  color: #999;
}

.toggles [aria-pressed]:focus,
.toggles [aria-pressed]:hover {
  color: #00f;
  outline: none;
}

.toggles [aria-pressed]:focus::before,
.toggles [aria-pressed]:hover::before {
  box-shadow: 0 0 0.5em #333;
}

.toggles [aria-pressed]:focus::after,
.toggles [aria-pressed]:hover::after {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='50' fill='rgba(0,0,0,.25)'/%3E%3C/svg%3E");
  background-size: 30%;
  background-repeat: no-repeat;
  background-position: center center;
}

.toggles [aria-pressed]::before,
.toggles [aria-pressed]::after {
  content: "";
  position: absolute;
  height: 1.5em;
  transition: all 0.25s ease;
}

.toggles [aria-pressed]::before {
  left: 0;
  top: 0.2em;
  width: 3em;
  border: 0.2em solid #767676;
  background: #767676;
  border-radius: 1.1em;
}

.toggles [aria-pressed]::after {
  left: 0;
  top: 0.25em;
  background-color: #fff;
  background-position: center center;
  border-radius: 50%;
  width: 1.5em;
  border: 0.15em solid #767676;
}

.toggles [aria-pressed=true]::after {
  left: 1.6em;
  border-color: #36a829;
  color: #36a829;
}

.toggles [aria-pressed=true]::before {
  background-color: #36a829;
  border-color: #36a829;
}

.toggles [aria-pressed][disabled]::before {
  background-color: transparent;
  border-color: #ddd;
}

.toggles [aria-pressed][disabled]::after {
  border-color: #ddd;
}

.toggles [aria-pressed][disabled]:hover {
  color: #999; /* case for CSS custom property if not supporting IE/Edge */
}

.toggles [aria-pressed][disabled]:hover::before {
  box-shadow: none;
}

.toggles [aria-pressed][disabled]:hover::after {
  background-image: none;
}

/* Put toggles on the right like the iOS the kids like */

.toggles.flip [aria-pressed]::before,
.toggles.flip [aria-pressed]::after {
  left: auto;
  right: 0;
}

.toggles.flip [aria-pressed]::after {
  left: auto;
  right: 1.6em;
}

.toggles.flip [aria-pressed=true]::after {
  right: 0;
}

.toggles.flip [aria-pressed] {
  padding-left: 0;
  padding-right: 4em;
}

/* Windows High Contrast Mode Support */
@media screen and (-ms-high-contrast: active) {
  .toggles [aria-pressed]:focus::before,
  .toggles [aria-pressed]:hover::before {
    outline: 1px dotted windowText;
    outline-offset: 0.25em;
  }
  .toggles [aria-pressed]::after {
    background-color: windowText;
  }
  .toggles [aria-pressed][disabled]::after {
    background-color: transparent;
  }
}

/* Reduced motion */
@media screen and (prefers-reduced-motion: reduce) {
  .toggles [aria-pressed]::before,
  .toggles [aria-pressed]::after {
    transition: none;
  }
}

/* Dark mode */
@media screen and (prefers-color-scheme: dark) {
  .toggles {
    color: #fff;
    background-color: #101010;
  }
  fieldset.toggles {
    border: 0.1em solid rgba(255, 255, 255, 0.15);
  }
  .toggles [aria-pressed]:focus,
  .toggles [aria-pressed]:hover {
    color: #99f;
  }
  .toggles [aria-pressed]::before {
    border-color: #808080;
    background: #808080;
  }
  .toggles [aria-pressed]::after {
    background-color: #101010;
  }
  .toggles [aria-pressed]:focus::after,
  .toggles [aria-pressed]:hover::after {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='50' fill='rgba(255,255,255,.25)'/%3E%3C/svg%3E");
  }
  .toggles [aria-pressed][disabled]::before,
  .toggles [aria-pressed][disabled]::after {
    border-color: #555;
  }
}

/* RTL */
/* https://twitter.com/dror3go/status/1102946375396982784 */
*[dir="rtl"] .toggles [aria-pressed] {
  padding-left: 0;
  padding-right: 4em;
}

*[dir="rtl"] .toggles [aria-pressed]::before,
*[dir="rtl"] .toggles [aria-pressed]::after {
  left: auto;
  right: 0;
}

*[dir="rtl"] .toggles [aria-pressed]::after {
  right: 0;
}

*[dir="rtl"] .toggles [aria-pressed=true]::after {
  right: 1.6em;
}

/* Put toggles on the right like the iOS the kids like */

*[dir="rtl"] .toggles.flip [aria-pressed]::before,
*[dir="rtl"] .toggles.flip [aria-pressed]::after {
  left: 0;
  right: auto;
}

*[dir="rtl"] .toggles.flip [aria-pressed]::after {
  right: auto;
  left: 1.6em;
}

*[dir="rtl"] .toggles.flip [aria-pressed=true]::after {
  left: 0;
}

*[dir="rtl"] .toggles.flip [aria-pressed] {
  padding-right: 0;
  padding-left: 4em;
}
            
          
!
            
              function toggle(btnID) {
  var theButton = document.getElementById(btnID);
  if (theButton.getAttribute("aria-pressed") == "false") {
    theButton.setAttribute("aria-pressed", "true");
  } else {
    theButton.setAttribute("aria-pressed", "false");
  }
}

function flipLogical() {
  var theQuote = document.getElementsByTagName("blockquote");
  for (var i = 0; i < theQuote.length; i++) {
    if (theQuote[i].getAttribute("class") == "typical") {
      theQuote[i].setAttribute("class", "logical");
    } else {
      theQuote[i].setAttribute("class", "typical");
    }
  }
}

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console