JSFiddle - React, Tailwind, and code Playground

by Alexandru Gatea

HTML

<div class="container">
    <div class="column">
        <div class="box a">I am on border-box with border bottom
        
        <br>
        No matter the border width, I'll always have 200x200px</div>
    </div>
        <div class="column">
        <div class="box a c">I am on border-box with box-shadow inset
        <br>
        No matter the border width, I'll always have 200x200px</div>
    </div>
    
    <div class="column">
        <div class="box b">I am on content-box
        <br>
         I'll always have 200x200px plus border thickness</div>
    </div>
</div>

SCSS

* {
    margin: 0;
    padding: 0;
}

.container {
    display: flex;
    height: 100vh;
    background: #eee;
}

.column {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.box {
    width: 200px;
    height: 200px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-bottom: 10px solid rgba(0,0,0,1);
}

.a {
    box-sizing: border-box;
}

.b {
    box-sizing: content-box;
}

.a.c {
    border: none;
    box-shadow: 0px -10px 0px 0px rgba(0,0,0,1) inset
;}