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

              
                <script type="module" src="https://cdn.jsdelivr.net/npm/last-icon@1/last-icon.js"></script>
 <header>
      <h1>
        <img
          width="16" height="16"
          src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0ElEQVRYR2MU7H73n2EAAeOoA0ZDYDQEBm0IsDMzMOyK5kUpId59/88QuPoL3lJjRRAPgxQPI4oav1VfGD78wF7c4CwHOFkYGJ4WCKIY9PLrPwbN6R/xOuBcCh+DggAzihrVqR8Y3n4fdcBoCIyGwGgIjIYAFULg99//DOdf/MVaFDcf/s5w9MkfBpoWxfgqgbiNXxi23P49jBzAwcLAcCSej+gGe+nebwz7H/xh2BjGwyDNy4Siz3XpZ4b3pFbHRNtMocLRfsFoCIyGwICHAAAS/RdQB1xBlQAAAABJRU5ErkJggg==" alt="Last Icon" />
      Last Icon</h1>
      <p><em>One custom icon element to rule them all</em></p>
    </header>
    <main>
      <h2>Basic usage</h2>
      <p>Simply use <code>&lt;l-i&gt;&lt;/l-i&gt;</code></p>
      <h2>Default icons</h2>
      <p>Set the name with <code>name="your-icon"</code> and, optionnaly, set a custom size with <code>size="xx"</code> (which is just a shortcut for setting style="--size:{xx}px")</p>
      <l-i name="star"></l-i>
      <l-i name="star" size="32"></l-i>
      <button><l-i name="star"></l-i> My button</button>
      <p>Icons are using <code>vertical-align:middle</code> by default and a <code>vertical-align:0.125em</code> offset when contained in a <code>p</code>, <code>button</code>, <code>a</code> or <code>span</code></p>
      
      <h2>
        Bootstrap Icons
        <a href="https://icons.getbootstrap.com/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="bootstrap"</code> or <code>set="bs"</code></p>
      <l-i name="star" set="bootstrap"></l-i>
      <l-i name="github" set="bs" style="--size: 24px"></l-i>
      <l-i name="alarm-fill" set="bs" style="--size: 36px; color: red"></l-i>
      <button><l-i name="github" set="bs"></l-i> Github</button>

      <h2>
        Box Icons
        <a href="https://boxicons.com/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="boxicons"</code> or <code>set="bx"</code></p>
      <l-i name="star" set="bx"></l-i>
      <p>You can specify the following types: <code>solid</code>, <code>regular</code>, <code>logos</code></p>
      <l-i name="star" set="bx" type="solid"></l-i>
      <l-i name="star" set="bx" type="regular"></l-i>
      <l-i name="github" set="bx" type="logos"></l-i>
      <button><l-i name="github" set="bx" type="logos"></l-i> Github</button>

      <h2>
        Tabler Icons
        <a href="https://tablericons.com/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="tabler"</code> or <code>set="tb"</code></p>
      <p><strong>This is the default set!</strong></p>
      <l-i name="star" set="tb"></l-i>
      <l-i name="rotate" set="tb"></l-i>
      <l-i name="zodiac-pisces" set="tb"></l-i>
      <button><l-i name="star" set="tb"></l-i> Github</button>
      <p>You can also set various widths using <code>stroke</code> attribute ! It can also be set globally with <code>defaultStroke</code>.</p>
      <l-i name="star" set="tb" stroke="1"></l-i>
      <l-i name="star" set="tb" stroke="2"></l-i>
      <l-i name="star" set="tb" stroke="3"></l-i>

      <h2>
        Materials Icons
        <a href="https://fonts.google.com/icons?selected=Material+Icons" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="material"</code> or <code>set="mi"</code></p>
      <l-i name="star" set="mi"></l-i>
      <l-i name="home" set="mi"></l-i>
      <button><l-i name="star" set="mi"></l-i> Github</button>
      <button><l-i name="star" set="mi" type="twotone"></l-i> Github</button>
      <p>You can specify the following types: <code>baseline</code>, <code>outline</code>, <code>round</code>, <code>sharp</code>, <code>twotone</code></p>
      <l-i name="home" set="mi" type="baseline"></l-i>
      <l-i name="home" set="mi" type="outline"></l-i>
      <l-i name="home" set="mi" type="round"></l-i>
      <l-i name="home" set="mi" type="sharp"></l-i>
      <l-i name="home" set="mi" type="twotone"></l-i>

      <h2>
        Css.gg Icons
        <a href="https://css.gg/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="cssgg"</code> or <code>set="cs"</code>or <code>set="gg"</code></p>
      <l-i name="add" set="gg"></l-i>
      <l-i name="alarm" set="gg"></l-i>
      <button><l-i name="alarm" set="gg"></l-i> Github</button>
      
      <h2>
        Font Awesome Icons
        <a href="https://fontawesome.com/cheatsheet" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="fontawesome"</code> or <code>set="fa"</code></p>
      <l-i name="star" set="fa"></l-i>
      <button><l-i name="star" set="fa"></l-i> Github</button>
      
      <h2>
        Super Tiny Icons
        <a href="https://github.com/edent/SuperTinyIcons" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="supertiny"</code> or <code>set="st"</code></p>
      <p>Super useful if you need the social icons with proper colors 👌</p>
      <l-i name="youtube" set="st"></l-i>
      <l-i name="twitter" set="st"></l-i>
      
      <h2>
        Flags Icons
        <a href="https://github.com/ducin/flag-svg-collection/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="flags"</code> or <code>set="fl"</code></p>
      <l-i name="be" set="fl"></l-i>
      <l-i name="fr" set="fl"></l-i>

      <h2>
        Emoji Icons
        <a href="https://github.com/buildbreakdo/emoji-cc/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="emojicc"</code> or <code>set="em"</code></p>
      <l-i name="smile" set="em"></l-i>

      <h2>
        Iconoir
        <a href="https://iconoir.com/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="iconoir"</code> or <code>set="in"</code></p>
      <l-i name="creative-commons" set="in"></l-i>
      <l-i name="server" set="in"></l-i>
      <button><l-i name="doc-star" set="in"></l-i> Star this document</button>

      <h2>
        EOS
        <a href="https://eos-icons.com/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="eos"</code> or <code>set="eo"</code></p>
      <p>You can specify the following types: <code>solid</code>, <code>outlined</code>, <code>animated</code></p>
      <p><em>Note: we use an alternative provider as the original repository structure is not very consistent</em></p>
      <l-i name="abstract" set="eo"></l-i>
      <l-i name="abstract" set="eo" type="outlined"></l-i>
      <l-i name="three_dots_loading" set="eo" type="animated"></l-i>
      <l-i name="typing" set="eo" type="animated"></l-i>
      <button><l-i name="add_task" set="eo"></l-i> Add task</button>

      <h2>
        Feather
        <a href="https://feathericons.com/" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="feather"</code> or <code>set="ft"</code></p>
      <p>You can also set various widths using <code>stroke</code> attribute !</p>
      <l-i name="activity" set="ft"></l-i>
      <l-i name="activity" set="ft" stroke="3"></l-i>
      <l-i name="activity" set="ft" stroke="1"></l-i>
      <button><l-i name="activity" set="ft"></l-i> Add activity</button>

      <h2>
        IconPark
        <a href="https://iconpark.oceanengine.com/official" target="_blank">
          <l-i name="external-link"></l-i>
        </a>
      </h2>
      <p>Use <code>set="iconpark"</code> or <code>set="ip"</code></p>
      <p>You can also set various widths using <code>stroke</code> attribute !</p>
      <p>You can set 4 themes (outline, filled, two-tone, multi-color): these need to be set in CSS.</p>
      <p><em>TODO: consider merging all the icons in one folder to avoid setting the type like what I did for eos icons</em></p>
      <l-i name="bookmark" set="ip" size="32" type="Base" stroke="4" theme="multi-color"></l-i>
      <l-i name="bookmark" set="ip" size="32" type="Base" theme="multi-color"></l-i>
      <l-i name="email-security" set="ip" size="32" type="Base" theme="multi-color"></l-i>
      <l-i name="camera" set="ip" size="32" type="Base" theme="multi-color"></l-i>
      <l-i name="bookmark" set="ip" size="32" type="Base" stroke="4" theme="two-tone"></l-i>
      <l-i name="bookmark" set="ip" size="32" type="Base" theme="two-tone"></l-i>
      <l-i name="email-security" set="ip" size="32" type="Base" theme="two-tone"></l-i>
      <l-i name="camera" set="ip" size="32" type="Base" theme="two-tone"></l-i>
      <button style="background:none;color:var(--color-text);"><l-i name="bookmark" set="ip" size="32" type="Base" theme="filled"></l-i> Add bookmark</button>
      <button><l-i name="bookmark" set="ip" size="32" type="Base" theme="outline"></l-i> Add bookmark</button>

      <h2>Invalid icons</h2>
      <p>Invalid icons are logged to the console and display a warning emoji</p>
      <l-i name="does-not-exist" set="em"></l-i>

      <h2>Animations and transformations</h2>

      <p>Use the same icon and rotate</p>

      <l-i name="chevron-left" size="32"></l-i>
      <l-i name="chevron-left" size="32" class="rotate-90"></l-i>
      <l-i name="chevron-left" size="32" class="rotate-180"></l-i>
      <l-i name="chevron-left" size="32" class="rotate-270"></l-i>
      <l-i name="chevron-left" size="32" class="flip-horizontal"></l-i>
      <l-i name="chevron-left" size="32" class="flip-vertical"></l-i>

      <p>Use the animation classes or they -hover variant</p>

      <l-i name="tank" size="32" class="spin"></l-i>
      <l-i name="tank" size="32" class="spin-hover"></l-i>
      <l-i name="tank" size="32" class="tada"></l-i>
      <l-i name="tank" size="32" class="tada-hover"></l-i>
      <l-i name="tank" size="32" class="flashing"></l-i>
      <l-i name="tank" size="32" class="flashing-hover"></l-i>
      <l-i name="tank" size="32" class="burst"></l-i>
      <l-i name="tank" size="32" class="burst-hover"></l-i>
      <l-i name="tank" size="32" class="fade-up"></l-i>
      <l-i name="tank" size="32" class="fade-up-hover"></l-i>
      <l-i name="tank" size="32" class="fade-down"></l-i>
      <l-i name="tank" size="32" class="fade-down-hover"></l-i>
      <l-i name="tank" size="32" class="fade-left"></l-i>
      <l-i name="tank" size="32" class="fade-left-hover"></l-i>
      <l-i name="tank" size="32" class="fade-right"></l-i>
      <l-i name="tank" size="32" class="fade-right-hover"></l-i>

      <h2>Advanced usage</h2>
      <h3>Host your own icons</h3>
      <p>You can point any library to a local path or to another cdn using <code>paths</code>.</p>
      <pre>
            window.LastIcon = {
              paths: {
                bootstrap: "./vendor/bootstrap",
              },
            };
      </pre>
      <h3>Change other settings</h3>
      <p>You can also configure the following settings: <code>aliases</code>, <code>types</code>, <code>prefixes</code>, <code>defaultSet</code></p>
      <pre>
            window.LastIcon = {
              types: {
                boxicons: "regular",
              },
              defaultSet: "boxicons",
            };
      </pre>
    </main>
    <footer>
      <hr />
      Made with <l-i name="heart" set="em"></l-i> in <l-i name="be" set="fl"></l-i> by <a href="https://www.lekoala.be">LeKoala</a>
    </footer>
              
            
!

CSS

              
                /* Recommended default styles */
l-i {
  --size: 1em;
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  width: var(--size);
  height: var(--size);
  vertical-align: middle;
}
l-i svg {
  display: block;
  width: 100%;
  height: 100%;
}
l-i i {
  font-size: var(--size) !important;
  color: currentColor;
}

p l-i:not([size]),
button l-i:not([size]),
a l-i:not([size]),
span l-i:not([size]) {
  vertical-align: -0.125em;
}

/* Material icon two tones for icon fonts */
.material-icons-two-tone {
  background-color: currentColor;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Icon park theming */
l-i[theme=multi-color] path[fill="#2F88FF"] {
  fill: var(--color);
}
l-i[theme=multi-color] path[fill="#43CCF8"] {
  fill: var(--color-secondary);
  stroke: var(--color-bg);
}
l-i[theme=multi-color] path[stroke=white] {
  stroke: white;
}
l-i[theme=multi-color] path[stroke=black] {
  stroke: #333;
}

l-i[theme=two-tone] path[fill="#2F88FF"] {
  fill: var(--color);
}
l-i[theme=two-tone] path[fill="#43CCF8"] {
  fill: var(--color);
}
l-i[theme=two-tone] path[stroke=white],
l-i[theme=two-tone] path[stroke=black] {
  stroke: #333;
}

l-i[theme=filled] path[fill] {
  fill: currentColor;
}
l-i[theme=filled] path[stroke=black] {
  stroke: white;
}

l-i[theme=outline] path[fill] {
  fill: none;
}
l-i[theme=outline] path[stroke=black] {
  stroke: currentColor;
}
l-i[theme=outline] path[fill="#43CCF8"] {
  fill: currentColor;
}

/* Optional features */
@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0);
            transform: rotate(0);
  }
  100% {
    -webkit-transform: rotate(359deg);
            transform: rotate(359deg);
  }
}
@keyframes spin {
  0% {
    -webkit-transform: rotate(0);
            transform: rotate(0);
  }
  100% {
    -webkit-transform: rotate(359deg);
            transform: rotate(359deg);
  }
}
@-webkit-keyframes burst {
  0% {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
  90% {
    -webkit-transform: scale(1.5);
            transform: scale(1.5);
    opacity: 0;
  }
}
@keyframes burst {
  0% {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
  90% {
    -webkit-transform: scale(1.5);
            transform: scale(1.5);
    opacity: 0;
  }
}
@-webkit-keyframes flashing {
  0% {
    opacity: 1;
  }
  45% {
    opacity: 0;
  }
  90% {
    opacity: 1;
  }
}
@keyframes flashing {
  0% {
    opacity: 1;
  }
  45% {
    opacity: 0;
  }
  90% {
    opacity: 1;
  }
}
@-webkit-keyframes fade-left {
  0% {
    -webkit-transform: translateX(0);
            transform: translateX(0);
    opacity: 1;
  }
  75% {
    -webkit-transform: translateX(-20px);
            transform: translateX(-20px);
    opacity: 0;
  }
}
@keyframes fade-left {
  0% {
    -webkit-transform: translateX(0);
            transform: translateX(0);
    opacity: 1;
  }
  75% {
    -webkit-transform: translateX(-20px);
            transform: translateX(-20px);
    opacity: 0;
  }
}
@-webkit-keyframes fade-right {
  0% {
    -webkit-transform: translateX(0);
            transform: translateX(0);
    opacity: 1;
  }
  75% {
    -webkit-transform: translateX(20px);
            transform: translateX(20px);
    opacity: 0;
  }
}
@keyframes fade-right {
  0% {
    -webkit-transform: translateX(0);
            transform: translateX(0);
    opacity: 1;
  }
  75% {
    -webkit-transform: translateX(20px);
            transform: translateX(20px);
    opacity: 0;
  }
}
@-webkit-keyframes fade-up {
  0% {
    -webkit-transform: translateY(0);
            transform: translateY(0);
    opacity: 1;
  }
  75% {
    -webkit-transform: translateY(-20px);
            transform: translateY(-20px);
    opacity: 0;
  }
}
@keyframes fade-up {
  0% {
    -webkit-transform: translateY(0);
            transform: translateY(0);
    opacity: 1;
  }
  75% {
    -webkit-transform: translateY(-20px);
            transform: translateY(-20px);
    opacity: 0;
  }
}
@-webkit-keyframes fade-down {
  0% {
    -webkit-transform: translateY(0);
            transform: translateY(0);
    opacity: 1;
  }
  75% {
    -webkit-transform: translateY(20px);
            transform: translateY(20px);
    opacity: 0;
  }
}
@keyframes fade-down {
  0% {
    -webkit-transform: translateY(0);
            transform: translateY(0);
    opacity: 1;
  }
  75% {
    -webkit-transform: translateY(20px);
            transform: translateY(20px);
    opacity: 0;
  }
}
@-webkit-keyframes tada {
  from {
    -webkit-transform: scale3d(1, 1, 1);
            transform: scale3d(1, 1, 1);
  }
  10%, 20% {
    -webkit-transform: scale3d(0.95, 0.95, 0.95) rotate3d(0, 0, 1, -10deg);
            transform: scale3d(0.95, 0.95, 0.95) rotate3d(0, 0, 1, -10deg);
  }
  30%, 50%, 70%, 90% {
    -webkit-transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, 10deg);
            transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, 10deg);
  }
  40%, 60%, 80% {
    -webkit-transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, -10deg);
            transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, -10deg);
  }
  to {
    -webkit-transform: scale3d(1, 1, 1);
            transform: scale3d(1, 1, 1);
  }
}
@keyframes tada {
  from {
    -webkit-transform: scale3d(1, 1, 1);
            transform: scale3d(1, 1, 1);
  }
  10%, 20% {
    -webkit-transform: scale3d(0.95, 0.95, 0.95) rotate3d(0, 0, 1, -10deg);
            transform: scale3d(0.95, 0.95, 0.95) rotate3d(0, 0, 1, -10deg);
  }
  30%, 50%, 70%, 90% {
    -webkit-transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, 10deg);
            transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, 10deg);
  }
  40%, 60%, 80% {
    -webkit-transform: rotate3d(0, 0, 1, -10deg);
            transform: rotate3d(0, 0, 1, -10deg);
  }
  to {
    -webkit-transform: scale3d(1, 1, 1);
            transform: scale3d(1, 1, 1);
  }
}
.spin {
  -webkit-animation: spin 2s linear infinite;
          animation: spin 2s linear infinite;
}

.spin-hover:hover {
  -webkit-animation: spin 2s linear infinite;
          animation: spin 2s linear infinite;
}

.tada {
  -webkit-animation: tada 1.5s ease infinite;
          animation: tada 1.5s ease infinite;
}

.tada-hover:hover {
  -webkit-animation: tada 1.5s ease infinite;
          animation: tada 1.5s ease infinite;
}

.flashing {
  -webkit-animation: flashing 1.5s infinite linear;
          animation: flashing 1.5s infinite linear;
}

.flashing-hover:hover {
  -webkit-animation: flashing 1.5s infinite linear;
          animation: flashing 1.5s infinite linear;
}

.burst {
  -webkit-animation: burst 1.5s infinite linear;
          animation: burst 1.5s infinite linear;
}

.burst-hover:hover {
  -webkit-animation: burst 1.5s infinite linear;
          animation: burst 1.5s infinite linear;
}

.fade-up {
  -webkit-animation: fade-up 1.5s infinite linear;
          animation: fade-up 1.5s infinite linear;
}

.fade-up-hover:hover {
  -webkit-animation: fade-up 1.5s infinite linear;
          animation: fade-up 1.5s infinite linear;
}

.fade-down {
  -webkit-animation: fade-down 1.5s infinite linear;
          animation: fade-down 1.5s infinite linear;
}

.fade-down-hover:hover {
  -webkit-animation: fade-down 1.5s infinite linear;
          animation: fade-down 1.5s infinite linear;
}

.fade-left {
  -webkit-animation: fade-left 1.5s infinite linear;
          animation: fade-left 1.5s infinite linear;
}

.fade-left-hover:hover {
  -webkit-animation: fade-left 1.5s infinite linear;
          animation: fade-left 1.5s infinite linear;
}

.fade-right {
  -webkit-animation: fade-right 1.5s infinite linear;
          animation: fade-right 1.5s infinite linear;
}

.fade-right-hover:hover {
  -webkit-animation: fade-right 1.5s infinite linear;
          animation: fade-right 1.5s infinite linear;
}

.rotate-90 {
  -webkit-transform: rotate(90deg);
          transform: rotate(90deg);
}

.rotate-180 {
  -webkit-transform: rotate(180deg);
          transform: rotate(180deg);
}

.rotate-270 {
  -webkit-transform: rotate(270deg);
          transform: rotate(270deg);
}

.flip-horizontal {
  -webkit-transform: scaleX(-1);
          transform: scaleX(-1);
}

.flip-vertical {
  -webkit-transform: scaleY(-1);
          transform: scaleY(-1);
}

/*# sourceMappingURL=last-icon.css.map */
              
            
!

JS

              
                // You can tweak settings by changing global variable
window.LastIcon = {
  // paths: {
  //   bootstrap: "./vendor/bootstrap",
  // },
  types: {
    boxicons: "regular"
  },
  defaultSet: "tabler"
  // defaultStroke: 1,
};

              
            
!
999px

Console