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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <div class=container-tbl>
  <table class=tbl-pt id=table>
    <caption class=-visually-hidden>Font size conversion</caption>
    <thead>
      <tr>
        <th colspan=6 class=tbl_col-6>Default considered as a 96dpi viewport with a <code>:root {font-size:16px}</code></th>
      </tr>
      <tr>
        <th scope=col><button aria-pressed=true class=btn-pt id=btn_pt value=pt aria-label="Order table by significant point sizes">Point</button></th>
        <th scope=col><button aria-pressed=false class=btn-px id=btn_px value=px aria-label="Order table by significant pixel sizes">Pixel</button></th>
        <th scope=col>Em / rem</th>
        <th scope=col>Percent</th>
        <th scope=col>Keyword</th>
        <th scope=col>Sans-serif <small>(default)</small></th>
      </tr>
    </thead>
    <tbody class=tbl_bdy id=table_body>

<tr>
  <th scope=row>6pt</th><td>8px</td><td>0.5em</td><td>50%</td><td></td><td><span style=font-size:6pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>6.75pt</th><td>9px</td><td>0.5625em</td><td>56.25%</td><td>xx-small</td><td><span style=font-size:6.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>7pt</th><td>9.333px</td><td>0.5833em</td><td>58.333%</td><td></td><td><span style=font-size:7pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>7.5pt</th><td>10px</td><td>0.625em</td><td>62.5%</td><td>x-small</td><td><span style=font-size:7.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>8pt</th><td>10.667px</td><td>0.6667em</td><td>66.667%</td><td></td><td><span style=font-size:8pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>8.25pt</th><td>11px</td><td>0.6875em</td><td>68.75%</td><td></td><td><span style=font-size:8.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>9pt</th><td>12px</td><td>0.75em</td><td>75%</td><td></td><td><span style=font-size:9pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>9.75pt</th><td>13px</td><td>0.8125em</td><td>81.25%</td><td></td><td><span style=font-size:9.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>10pt</th><td>13.333px</td><td>0.8333em</td><td>83.333%</td><td>small</td><td><span style=font-size:10pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>10.5pt</th><td>14px</td><td>0.875em</td><td>87.5%</td><td></td><td><span style=font-size:10.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>11pt</th><td>14.667px</td><td>0.9167em</td><td>91.667%</td><td></td><td><span style=font-size:11pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>11.25pt</th><td>15px</td><td>0.9375em</td><td>93.75%</td><td></td><td><span style=font-size:11.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>12pt</th><td>16px</td><td>1em</td><td>100%</td><td>medium</td><td><span style=font-size:12pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>12.75pt</th><td>17px</td><td>1.0625em</td><td>106.25%</td><td></td><td><span style=font-size:12.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>13pt</th><td>17.333px</td><td>1.0833em</td><td>108.333%</td><td></td><td><span style=font-size:13pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>13.5pt</th><td>18px</td><td>1.125em</td><td>112.5%</td><td>large</td><td><span style=font-size:13.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>14pt</th><td>18.667px</td><td>1.1667em</td><td>116.667%</td><td></td><td><span style=font-size:14pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>14.25pt</th><td>19px</td><td>1.1875em</td><td>118.75%</td><td></td><td><span style=font-size:14.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>15pt</th><td>20px</td><td>1.25em</td><td>125%</td><td></td><td><span style=font-size:15pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>15.75pt</th><td>21px</td><td>1.3125em</td><td>131.25%</td><td></td><td><span style=font-size:15.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>16pt</th><td>21.333px</td><td>1.3333em</td><td>133.333%</td><td></td><td><span style=font-size:16pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>16.5pt</th><td>22px</td><td>1.375em</td><td>137.5%</td><td></td><td><span style=font-size:16.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>17pt</th><td>22.667px</td><td>1.4167em</td><td>141.667%</td><td></td><td><span style=font-size:17pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>17.25pt</th><td>23px</td><td>1.4375em</td><td>143.75%</td><td></td><td><span style=font-size:17.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>18pt</th><td>24px</td><td>1.5em</td><td>150%</td><td>x-large</td><td><span style=font-size:18pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>18.75pt</th><td>25px</td><td>1.5625em</td><td>156.25%</td><td></td><td><span style=font-size:18.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>19pt</th><td>25.333px</td><td>1.5833em</td><td>158.333%</td><td></td><td><span style=font-size:19pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>19.5pt</th><td>26px</td><td>1.625em</td><td>162.5%</td><td></td><td><span style=font-size:19.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>20pt</th><td>26.667px</td><td>1.6667em</td><td>166.667%</td><td></td><td><span style=font-size:20pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>20.25pt</th><td>27px</td><td>1.6875em</td><td>168.75%</td><td></td><td><span style=font-size:20.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>21pt</th><td>28px</td><td>1.75em</td><td>175%</td><td></td><td><span style=font-size:21pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>21.75pt</th><td>29px</td><td>1.8125em</td><td>181.25%</td><td></td><td><span style=font-size:21.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>22pt</th><td>29.333px</td><td>1.8333em</td><td>183.333%</td><td></td><td><span style=font-size:22pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>22.5pt</th><td>30px</td><td>1.875em</td><td>187.5%</td><td></td><td><span style=font-size:22.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>23pt</th><td>30.667px</td><td>1.9167em</td><td>191.667%</td><td></td><td><span style=font-size:23pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>23.25pt</th><td>31px</td><td>1.9375em</td><td>193.75%</td><td></td><td><span style=font-size:23.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>24pt</th><td>32px</td><td>2em</td><td>200%</td><td>xx-large</td><td><span style=font-size:24pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>24.75pt</th><td>33px</td><td>2.0625em</td><td>206.25%</td><td></td><td><span style=font-size:24.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>25pt</th><td>33.333px</td><td>2.0833em</td><td>208.333%</td><td></td><td><span style=font-size:25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>25.5pt</th><td>34px</td><td>2.125em</td><td>212.5%</td><td></td><td><span style=font-size:25.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>26pt</th><td>34.667px</td><td>2.1667em</td><td>216.667%</td><td></td><td><span style=font-size:26pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>26.25pt</th><td>35px</td><td>2.1875em</td><td>218.75%</td><td></td><td><span style=font-size:26.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>27pt</th><td>36px</td><td>2.25em</td><td>225%</td><td></td><td><span style=font-size:27pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>27.75pt</th><td>37px</td><td>2.3125em</td><td>231.25%</td><td></td><td><span style=font-size:27.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>28pt</th><td>37.333px</td><td>2.3333em</td><td>233.333%</td><td></td><td><span style=font-size:28pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>28.5pt</th><td>38px</td><td>2.375em</td><td>237.5%</td><td></td><td><span style=font-size:28.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>29pt</th><td>38.667px</td><td>2.4167em</td><td>241.667%</td><td></td><td><span style=font-size:29pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>29.25pt</th><td>39px</td><td>2.4375em</td><td>243.75%</td><td></td><td><span style=font-size:29.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>30pt</th><td>40px</td><td>2.5em</td><td>250%</td><td></td><td><span style=font-size:30pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>30.75pt</th><td>41px</td><td>2.5625em</td><td>256.25%</td><td></td><td><span style=font-size:30.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>31pt</th><td>41.333px</td><td>2.5833em</td><td>258.333%</td><td></td><td><span style=font-size:31pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>31.5pt</th><td>42px</td><td>2.625em</td><td>262.5%</td><td></td><td><span style=font-size:31.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>32pt</th><td>42.667px</td><td>2.6667em</td><td>266.667%</td><td></td><td><span style=font-size:32pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>32.25pt</th><td>43px</td><td>2.6875em</td><td>268.75%</td><td></td><td><span style=font-size:32.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>33pt</th><td>44px</td><td>2.75em</td><td>275%</td><td></td><td><span style=font-size:33pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>33.75pt</th><td>45px</td><td>2.8125em</td><td>281.25%</td><td></td><td><span style=font-size:33.75pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>34pt</th><td>45.333px</td><td>2.8333em</td><td>283.333%</td><td></td><td><span style=font-size:34pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>34.5pt</th><td>46px</td><td>2.875em</td><td>287.5%</td><td></td><td><span style=font-size:34.5pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>35pt</th><td>46.667px</td><td>2.9167em</td><td>291.667%</td><td></td><td><span style=font-size:35pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>35.25pt</th><td>47px</td><td>2.9375em</td><td>293.75%</td><td></td><td><span style=font-size:35.25pt!important>Sample</span></td>
</tr>
<tr>
  <th scope=row>36pt</th><td>48px</td><td>3em</td><td>300%</td><td></td><td><span style=font-size:36pt!important>Sample</span></td>
</tr>

    </tbody>
  </table>
</div>


<!-- Footer codepen include -->
[[[https://codepen.io/2kool2/pen/mKeeGM]]]

              
            
!

CSS

              
                /* Generic styling */

html{font-family: sans-serif; box-sizing: border-box; line-height: 1.5}
*,:after,:before{box-sizing: inherit}
body,button{text-rendering: optimizeLegibility}
body{background-color: #ddd; color: #3a2c49; margin:0 1rem}
main{max-width:34rem;margin:0 auto}
h1{color: #4B3D5A; font-weight:100; font-size: 2rem; margin: .618rem 0}
a{background: transparent; color: #236ECE; text-decoration: none}
a:hover,a:focus,a:active{color: #014cac}
p a:hover,a:focus,li a:hover,a:focus{text-decoration: underline; outline: 0}
body {background: #fffffa url("data:image/svg+xml;charset=utf8,%3Csvg width='1200' height='256' viewBox='0 0 1200 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.4'%3E%3C/feTurbulence%3E%3C/filter%3E%3C/defs%3E%3Crect height='256' width='1200' filter='url(%23noise)' opacity='.3'/%3E%3C/svg%3E");}

.-visually-hidden {
    position: absolute !important;
    clip: rect(1px,1px,1px,1px);
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden;
}
.-nowrap {
    white-space: nowrap;
}

code {
  font-size: 1rem;
  display: block;
}

/* TABLE */
.container-tbl {
  max-width: 100%;
  overflow: hidden;
  overflow-x: scroll;
}

[class^="tbl-"] {
  --hoverColor: #000;
  --hoverBg: hsla(120, 100%, 99.5%, 0.7);
  --highlightColor: #030;
  --highlight: hsla(120, 80%, 90%, 0.5);
  --highlightHoverBg: hsla(120, 100%, 100%, 1);
  --oddBg: hsla(120, 50%, 50%, 0.075);
  --separater: hsla(120, 100%, 100%, 0.8);
  border-collapse: collapse;
  background-color: var(--oddBg);
  border: 2px solid var(--oddBg);
}

.tbl-pt [scope]:nth-child(1),
.tbl-px [scope]:nth-child(2),
.tbl-pt .tbl_bdy td:nth-child(1),
.tbl-px .tbl_bdy td:nth-child(2) {
  color: var(--highlightColor);
  background-color: var(--highlight);
}
.tbl_bdy tr:nth-child(odd) {
  background-color: var(--oddBg);
}
.tbl_bdy tr:hover {
  color: var(--hoverColor);
  background-color: var(--hoverBg);
}
[class^="tbl-"] .tbl_bdy tr:hover th {
/*   color: var(--hoverColor); */
  background-color: var(--highlightHoverBg);
}
.tbl_bdy td:nth-child(1),
.tbl-pt .tbl_bdy th {
  min-width: 4.4rem;
}
.tbl_bdy td:nth-child(2),
.tbl-px .tbl_bdy th {
  min-width: 4.8rem;
}
.tbl_bdy td:nth-child(3) {
  min-width: 4.5rem;
}
.tbl_bdy td:nth-child(4) {
  min-width: 5.1rem;
}
.tbl_bdy td:nth-child(5) {
  min-width: 4.2rem;
}
th:nth-child(n+3) {
  font-size: .9rem;
  font-weight: 500;
}
th {
  text-align: left;
  padding: .25rem .125rem;
  padding: .25rem;
}
.tbl_bdy th {
  font-weight: 400;
}
td {
  padding: .25rem;
}
tr:nth-child(n+14) {line-height: 1.25;}
tr:nth-child(n+18) {line-height: 1;}
tr:nth-child(n+29) {line-height: 0.8;}

.tbl_col-6 {
  font-weight: 300;
  text-align: center;
  line-height: 1.5;
  padding: .25rem;
}
tr :nth-child(n+2) {
  box-shadow: -1px 0 var(--separater);
}


/* BUTTONS - https://codepen.io/2kool2/pen/GvNVOO */

[class^="btn-"]::-moz-focus-inner {
  padding: 0 !important;
  border: 0 none !important;
}
[class^="btn-"] {
  width: 100%;

  white-space: pre;
  overflow: visible;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: button;
  -webkit-appearance: none;
  
  /* Safari fix for thin text on hover */
  -webkit-font-smoothing: subpixel-antialiased;
 
  padding: .25rem;
  color: #FFF;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
/*   background: #060 none repeat scroll 0% 0%; */
  border: 1px solid #242424;
  border-radius: .25rem;

  position: relative;
  display: inline-block;
  font-size: inherit;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  outline: 0 solid;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 0 0 rgba(0, 0, 0, 0.5) inset,
    0 1.25em 0 rgba(255, 255, 255, 0.08) inset,
    0 -1.25em 1.25em rgba(0, 0, 0, 0.3) inset,
    0 1.25em 1.25em rgba(255, 255, 255, 0.1) inset;
  transition: box-shadow 0.3s ease-out,  transform 0.3s ease-out;
}
[class^="btn-"]:hover,
[class^="btn-"]:focus {
  text-decoration: none;
  transform: scale(1.05);
  will-change: transform, box-shadow;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 0 0 rgba(0, 0, 0, 0.25) inset,
    0 20px 0 rgba(255, 255, 255, 0.03) inset,
    0 -20px 20px rgba(0, 0, 0, 0.15) inset,
    0 20px 20px rgba(255, 255, 255, 0.05) inset;
}
[class^="btn-"]:active {
  animation: btn_pressed 1s;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 0 rgba(255, 255, 255, 0) inset,
    0 0 5px rgba(0, 0, 0, 0.5) inset,
    0 20px 0 rgba(255, 255, 255, 0.03) inset,
    0 -20px 20px rgba(0, 0, 0, 0.15) inset,
    0 20px 20px rgba(255, 255, 255, 0.05) inset;
}
[class^="btn-"]::before {
  content: "";
  display: block;
  position: absolute;
  background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 100%);
  background:linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 100%);
  padding: 0 12px;
  top: 0;
  left: 15%;
  height: 1px;
  width: 40%;
  box-shadow: 0 1px 5px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease-in-out 0s;
}
[class^="btn-"]:active::before {
  opacity: 0;
}
[class^="btn-"]:hover::before {
  left: 45%;
}

/* BUTTON colours */
[class^="btn-"] {
  background-color: #040;
}
[class^="btn-"][aria-pressed="true"] {
  background-color: #080;
}
[class^="btn-"][aria-pressed="false"]:hover,
[class^="btn-"][aria-pressed="false"]:focus {
  background-color: #0a0;
}

/* BUTTON click animation */
[class^="btn"].-js-clicked {
  animation: btn-pressed .3s ease-out forwards;
}
@keyframes btn-pressed {
  50% {
    transform: scale(.95);
    box-shadow:
      0 0 0 rgba(255, 255, 255, 0),
      0 1px 0 rgba(255, 255, 255, 0) inset,
      0 0 .5em rgba(0, 0, 0, 0.5) inset,
      0 1.25em 0 rgba(255, 255, 255, 0.03) inset,
      0 -1.25em 1.25em rgba(0, 0, 0, 0.15) inset,
      0 1.25em 1.25em rgba(255, 255, 255, 0.05) inset;
  }
}
              
            
!

JS

              
                var supportsES6 = (function() {
  // https://gist.github.com/bendc/d7f3dbc83d0f65ca0433caf90378cd95
  try {
    new Function('(a = 0) => a');
    return true;
  }
  catch (err) {
    return false;
  }
}());


var Populate_Font_Size_Table = (function (window, document) {

  'use strict';
  if (!supportsES6) return;

  const root_fs = 16;
  const table = document.getElementById('table');
  const table_body = document.getElementById('table_body');
  if (!(table && table_body)) return;


  // Limit to rounded decimal places.
  const sanitize = (value, places) => Math.round(value * Math.pow(10, places)) / Math.pow(10, places);


  const convert = {
    px : {
      value : 'px',
      btn : document.getElementById('btn_px'),
      from: 8,
      to : 48,
      step : 1,
      to_pix : 1,
      exitTest : (pix, count) => false
    },
    pt : {
      value : 'pt',
      btn : document.getElementById('btn_pt'),
      from: 6,
      to : 36,
      step : 0.25,
      to_pix : 96 / 72,
      exitTest : (pix, count) => 
        !Number.isInteger(pix) && !Number.isInteger(count)
    },

    build_html : (pix, type) => `
<tr>
  <${(type === 'pt' ? 'th scope="row"' : 'td')}>${sanitize(pix * 72 / 96, 2)}pt<${(type === 'px' ? '/th' : '/td')}><${(type === 'px' ? 'th scope="row"' : 'td')}>${sanitize(pix, 3)}px<${(type === 'px' ? '/th' : '/td')}><td>${sanitize(pix / root_fs, 4)}em</td><td>${sanitize(pix * 100 / root_fs, 3)}%</td><td>${_getKeyword(type, pix)}</td><td><span style="font-size:${pix / convert[type].to_pix}${type} !important">Sample</span></td>
</tr>`,

    display : type => {
      const unit = convert[type];
      let html = '';
      for (let i = unit.from; i <= unit.to; i += unit.step) {
        const pix = i * unit.to_pix;
        if (unit.exitTest(pix, i)) continue;
        html += convert.build_html(pix, unit.value);
      }
      table_body.innerHTML = html;
    }

  }


  const keywords = {
    px : {
      9 : 'xx-small',
      10 : 'x-small',
      13 : 'small',
      16 : 'medium',
      18 : 'large',
      24 : 'x-large',
      32 : 'xx-large'
    },
    pt : {
      6.75 : 'xx-small',
      7.5 : 'x-small',
      10 : 'small',
      12 : 'medium',
      13.5 : 'large',
      18 : 'x-large',
      24 : 'xx-large'
    }
  };


  function _getKeyword (unit, pix) {

    const value = sanitize(pix / convert[unit].to_pix, 2);
    let word = '';

    Object.keys(keywords[unit]).forEach(val => {
      if (val == value) {
        word = keywords[unit][val];
      }
      // word = (val == value) ? keywords[unit][val] : '';
    });

    return word;
  }


  /* BUTTONS */

  const clearBtnsPressed = _ => 
    Object.values(convert).forEach(obj => {
      (obj.btn && obj.btn.setAttribute('aria-pressed', false));
    });


  const btn_clicked = e => {
    const btn = e.target;
    clearBtnsPressed();
    btn.setAttribute('aria-pressed', true);
    table.setAttribute('class', 'tbl-' + btn.value);
    convert.display(btn.value);
  }


  function init() {

    // Object.keys(convert).forEach(key => {
    //   // console.log(key, convert[key].value);
    //   if (!convert[key].btn) return;
    //   convert[key].btn.addEventListener('click', btn_clicked);
    // });

    // Object.entries(convert).forEach(([key, obj]) => {
    //   // console.log(`${key}:${obj.value}`);
    //   obj.btn && obj.btn.addEventListener('click', btn_clicked);
    // });

    // Object.values(convert).forEach(obj => {
    //    // console.log(obj.btn);
    //   obj.btn && obj.btn.addEventListener('click', btn_clicked);
    // });

    Object.values(convert).forEach(obj => {
      (obj.btn && obj.btn.addEventListener('click', btn_clicked));
    });
  }

  init();

}(window, document));



// Button click animation
// https://codepen.io/2kool2/pen/GvNVOO

var Button_Click_Animation = (function (window, document) {

  'use strict';
  if (!supportsES6) return;

  const buttons = document.querySelectorAll('[id^=btn_]');
  const clickedClass = '-js-clicked';

  const btn_clicked = e => {
    const btn = e.target;
    btn.classList.add(clickedClass);
    btn.addEventListener('animationend', e => {
      btn.classList.remove(clickedClass);
    }, {once: true});
    btn.focus();
  };

  Object.values(buttons).forEach(btn => {
    btn.addEventListener('click', btn_clicked);
    btn.addEventListener('blur', e => {
      e.target.classList.remove(clickedClass);
    });
  });

}(window, document));

              
            
!
999px

Console