cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <h1 style="margin-bottom: 1em;"><a href="http://csswizardry.com/2016/10/pure-css-content-filter/">Pure CSS Content Filter</a></h1>

<section class="c-filter">

  <a class="c-filter__target" id="tag:css"></a>
  <a class="c-filter__target" id="tag:html"></a>
  <a class="c-filter__target" id="tag:accessibility"></a>
  <a class="c-filter__target" id="tag:performance"></a>
  <a class="c-filter__target" id="tag:vim"></a>

  <nav class="c-filter__links">
    <a href="#tag:all" class="c-filter__link  c-filter__link--reset">All</a>
    <a href="#tag:html" class="c-filter__link">HTML</a>
    <a href="#tag:css" class="c-filter__link">CSS</a>
    <a href="#tag:accessibility" class="c-filter__link">Accessibility</a>
    <a href="#tag:performance" class="c-filter__link">Performance</a>
    <a href="#tag:vim" class="c-filter__link">Vim</a>
  </nav>

  <article class="c-article c-filter__item" data-tag="vim">
    <h2>Using Macros</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article c-filter__item" data-tag="css performance">
    <h2>Critical CSS</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article c-filter__item" data-tag="html accessibility">
    <h2>Button vs. Anchor</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="css html">
    <h2>Understanding BEM(IT)</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="performance">
    <h2>How gzip works</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="accessibility html">
    <h2>Intro to ARIA</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="performance">
    <h2>Image Formats</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="accessibility">
    <h2>Configuring your screenreader</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="css">
    <h2>Pure CSS Content Filter</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="vim">
    <h2>Understanding Vim’s dot command</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="performance">
    <h2>Improving Rendering Performance</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

  <article class="c-article  c-filter__item" data-tag="html">
    <h2>Text-level Semantics</h2>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies
    eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
    Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
  </article>

</section>
            
          
!
            
              .c-filter {
  overflow: hidden;
}

  /**
   * Make the targets hover at the top of the viewport so that we never get
   * awkward page jumps when filtering.
   */
  .c-filter__target {
    position: fixed;
  }

  .c-filter__links {
    padding: 1em;
    margin-bottom: 1em;
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
  }

    .c-filter__link {
      display: inline-block;
      padding: 0.5em 1em;
      border-radius: 100px;
      background-color: rgba(0, 0, 0, 0);
      transition: 0.333s;
    }

    .c-filter__link--reset {
      border-right: 1px solid #e5e5e5;
      border-radius: 0;
    }

  .c-filter__item {
    float: left;
    width: calc(33.333333333% - 1em);
    margin-right: 0.5em;
    margin-bottom: 1em;
    margin-left: 0.5em;
    transition: 0.333s;
  }





/**
 * If we haven’t targeted anything, ensure all items are turned on.
 */
.c-filter__target:not(:target) ~ .c-filter__item {
  opacity: 1;
  visibility: visible;
}

/**
 * As soon as we target anything, turn all items ‘off’.
 */
.c-filter__target:target ~ .c-filter__item {
  opacity: 0;
  visibility: hidden;
}


%current-item {
  opacity: 1;
  visibility: visible;
}
%current-link {
  background-color: #f43059;
  color: #fff;
  pointer-events: none;
}

@each $tag in html, css, accessibility, performance, vim {

  /**
   * Turn specific items back on when they have been targeted.
   */
  [id="tag:#{$tag}"]:target ~ [data-tag~="#{$tag}"] {
    @extend %current-item;
  }

  /**
   * Highlight the currently filtered link.
   */
  [id="tag:#{$tag}"]:target ~ .c-filter__links [href="#tag:#{$tag}"] {
    @extend %current-link;
  }

}





.c-article {
  background-color: #fff;
  padding: 1em;
  border-bottom: 1px solid #e5e5e5;
}


























































* {
  margin:  0;
  padding: 0;
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  font: menu;
  padding: 1%;
  background-color: #fafafa;
  color: #333;
}

a {
  text-decoration: none;
  color: #f43059;
}
            
          
!
999px
Loading ..................

Console