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


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


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.


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.


      <div class="site-branding">
        <div class="ast-site-identity" itemtype="" itemscope="itemscope">
          <span class="site-logo-img">
            <!-- This link will be overridden by JavaScript code. -->
            <a href="" class="custom-logo-link" rel="home">
                class="custom-logo" alt="cme dev logo white" width="80" height="80">

      <h1>Override the Logo &amp; Link for the Astra Theme Header</h1>
      <p><strong>Astra</strong> does not <em>respect</em> the header logo link when the default logo is swapped out via CSS. So, let's use some JavaScript to fix that.</p>

      <p>For medium-to-wide screens, let's display the <em>Bali Street Photographer</em> logo with the link to</p>

      <p>For mobile devices, we'll display the <em>Caught My Eye</em> logo with the link to</p>
      <p>This <em>use case</em> comes in handy when working with WordPress themes and you want a different logo link depending on the page or device size.</p>


                :root {
  --accent-colour: ghostwhite;

body {
  background-color: #212326; /* Light black. */
  color: WhiteSmoke;
  font-family: Helvetica, Arial, san-serif;
  font-size: 18px;
  padding: 1% 5%;

h1, h2, h3 {
  font-weight: normal;

header {
  padding: 1%;
  border: 2px solid var(--accent-colour);

section {
  width: 95%;

@media screen and (min-width: 1024px) {
  section {
    width: 75%;

mark {
  padding: 0.2% 1%;

footer {
  margin-top: 15%;
  border-top: 2px solid var(--accent-colour);


 * Override the logo link for mobile.

// Breakpoints
const mobBreak = '767.998px';

// Create the query list.
const mediaQueryList = window.matchMedia('(max-width: ' + mobBreak + ')');

// Define a callback function for the event listener.
function handleWindowSizeChange(mql) {

  let link = document.querySelector(".site-logo-img a");
  let img = document.querySelector(".site-logo-img a img");
  // Test the media query.
  if (mql.matches) {
    link.setAttribute("href", "");
    img.setAttribute("src", "");
    img.setAttribute("title", "Caught My Eye");
  } else {
    link.setAttribute("href", "");
    img.setAttribute("src", "");
    img.setAttribute("title", "Bali Street Photographer");


// Run the window size change handler once.

// Add the callback function as a listener to the query list.