CodePen

HTML

            
              <h1>Responsive blockquote using elementQuery</h1>
<p>Try changing the: viewport width, height of <code>blockquote</code> elements, base font-size, or zoom.</p>
<p>The following <a href="https://github.com/tysonmatanich/elementQuery">elementQuery</a> breakpoints are set:</p>
<ul>
    <li><code>min-height: 4.75em /* 76px */</code></li>
</ul>

<div class="container" style="font-size: 1em;">
    <p>Short blockquote in a container with <code>font-size: 1em</code>.</p>
    <blockquote>Height based element queries!</blockquote>
</div>
<div class="container" style="font-size: 1em;">
    <p>Blockquote in a container with <code>font-size: 1em</code>.</p>
    <blockquote>Element queries allow for new possibilities, such as change in appearance as an element's height changes.</blockquote>
</div>
<div class="container" style="font-size: 2em;">
    <p>Blockquote in a container with <code>font-size: 2em</code>.</p>
    <blockquote>Element queries allow for new possibilities, such as change in appearance as an element's height changes.</blockquote>
</div>
            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              body {
    font-family: sans-serif;
}

.container {
    margin-top: 1em;
    border: 2px solid #ccc;
    border-radius: 0.25em;
    padding: 1em;
}

blockquote {
    min-height: 1em;
    margin: 0;
    padding: 1em 2em;
    border-left: 0.5em solid #0094ff;
    border-right: 0.5em solid #0094ff;
    border-radius: 0.25em;
    background-color: #eee;
    line-height: 1.5em;
    color: #0082e0;
}

blockquote[min-height~="4.75em"] {
    padding: 1em 3em;
    border-left: 0;
    border-right: 0;
    border-top: 0.5em solid #74bd0a;
    border-bottom: 0.5em solid #74bd0a;
    font-style: italic;
    color: #619b0d;
}

h1 {
    font-size: 1.25em;
}

p {
    margin: 0 0 1em;;
}

code {
    padding: 0.25em 0.5em;
    color: #000;
    background-color: #f9f9f9;
}

a {
    color: #3a97c4;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................