JSFiddle - React, Tailwind, and code Playground
by Alexandru Gatea
HTML
<button>Button</button>
<span class="width">Width: <span></span></span>
<span class="height">Height: <span></span></span>
CSS
* {
box-sizing: border-box;
}
body {
padding: 100px;
background: #1f1f1f;
color: #fefefe;
}
button {
min-width: 145px;
border-radius: 8px;
padding: 7px 15px;
font-size: 14px;
line-height: 20px;
font-weight: 600;
letter-spacing: 2px;
font-family: "Raleway", sans-serif;
text-transform: uppercase;
border: 0;
box-shadow: inset 0px 0px 0px 2px #070318;
background: #0e0727;
color: #fff;
outline: none;
}
span {
margin-top: 20px;
display: flex;
}
span span {
display: inline;
margin: 0;
}
JavaScript
$(".width span").text($("button").outerWidth());
$(".height span").text($("button").outerHeight());