Pen Settings

HTML

CSS

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

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

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.

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

              
                <header>
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/23690/LevelAccess-Logo-frombluetext.png" alt="LEVEL access">
</header>

<main>
  <h1>Focus styling</h1>

  <p>One of the most significant things you can do to improve the accessibility of your work is to create <strong>highly visible focus indicators</strong>. There are many people with disabilities that use a keybaord and rely on focus indicators to see where their cursor is on the screen.</p>
  
 <p>Tabbing through this section shows a <em>very</em> subtle focus outline. In this case, <code>outline: none</code> is used to remove the blue glowing webkit outline, likely because someone didn't like the look of the blue glow. Instead they add a subtle outline for the focus state. Too subtle. Tab through and see for yourself:</p>   
<ul role="complementary">
  <li><a href="#item1">How do I login to the system?</a></li>
  <li><a href="#item2">How do I reset my password?</a></li>
  <li><a href="#item3">How do I enable 2 factor authentication?</a></li>
  <li><a href="#item4">How do I login on my cell phone?</a></li>
</ul> 
  <hr>
  
  <p>At a minimum, we should use the same <code>:hover</code> style. Here's the same code as above, with <code>text-decoration: underline</code> added for the focus state. This should be a little easier to follow when you're tabbing through.</p>
  
<ul role="complementary" class="half">
  <li><a href="#item1">How do I login to the system?</a></li>
  <li><a href="#item2">How do I reset my password?</a></li>
  <li><a href="#item3">How do I enable 2 factor authentication?</a></li>
  <li><a href="#item4">How do I login on my cell phone?</a></li>
</ul> 
  
  <hr>
  
  <p>But that's not quite good enough either. So, in addition to the <code>text-decoration</code> style, we add in a distinct outline that uses existing brand colours. Now when you're tabbing through, you can't miss the focus style.</p>
  
<ul role="complementary" class="full">
  <li><a href="#item1">How do I login to the system?</a></li>
  <li><a href="#item2">How do I reset my password?</a></li>
  <li><a href="#item3">How do I enable 2 factor authentication?</a></li>
  <li><a href="#item4">How do I login on my cell phone?</a></li>
</ul>  
  
  
  
  
</main>
<footer>
  <p><img id="avatar" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/23690/derek-400.jpg" alt="Photo, Derek Featherstone, while speaking at a conference, shown side profile with beard and over-the-ear microphone."> I'm Derek Featherstone, Chief eXperience Officer at Level Access. I can help you with accessibility and inclusive design.</p>
<p><a href="http://twitter.com/feather">Ping me on twitter</a>, or on <a href="http://linkedin.com/in/derekfeatherstone">LinkedIn</p></footer>
              
            
!

CSS

              
                :root {
 --main-bg-color: #e5f4f1; 
 --main-fg-color: #0F4880;
 --weak-focus: #999;
}

html {
    font-size: 62.5%;
}

body {
  font-family: Museo Sans, Open Sans, Sans serif; 
  padding: 3%;
  font-size: 1.8rem;
}

header, footer {
  text-align: right;
}

header img {
    vertical-align: middle;
}

code {
  font-family: monospace;
  border: 1px solid #ccc;
  padding: .2rem .5rem;
  border-radius: 6px;
  background-color: #efefef;
  box-shadow: 1px 1px 1px #ababab;
}

footer  {
  width: 35%;
  position: absolute;
  right: 2em;
  font-size: 1.6rem;
}

#avatar {
  height: 140px;
  width: 140px;
  border-radius: 140px;
  float: right;
  margin: 0 1em;
  vertical-align: top;
}

p {
  line-height: 1.3;
  margin: 0 0 2em;
  min-width: 10em;
  max-width: 40em;
  
}

hr {
  margin: 3em 0;
  border: 0;
  border-bottom: 1px dashed #ccc;
  width: 40em;
}


ul[role=complementary] {
  all:unset;
  background-color: var(--main-bg-color);
  color: var(--main-fg-color);
  border-bottom: 1px solid #333333;
}

ul[role=complementary] li {
  display: block;
  width: 20em;
}

ul[role=complementary] a {
  display: block;
  padding: 1em;
  width: 100%;
  background-color: var(--main-bg-color);
  color: var(--main-fg-color);
  border: 1px solid #cccccc;
}

a {
  text-decoration:none;
  outline: 0;
}

a:hover {
  text-decoration: underline;
}

a:focus {
  outline: 1px dotted var(--weak-focus);
}

ul[role=complementary].half a:focus {
  text-decoration: underline;
}

ul[role=complementary].full a:focus {
  text-decoration: underline;
  outline: 2px solid var(--main-fg-color);
}


              
            
!

JS

              
                
              
            
!
999px

Console