JSFiddle - React, Tailwind, and code Playground

by suhyunified

HTML

<div class="toggle">
  <div class="toggle__tag">
    USD
  </div>
  <div class="toggle__tag">
    KRW
  </div>
</div>

SCSS

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Mono&display=swap');

* {
  font-family: 'Noto Sans Mono', monospace;
  padding: 0;
  margin: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  
  height: 100vh;
}

.toggle {
  display: flex;
  position: relative;

  padding: 12px;
  

  &__tag {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #34427A;  
    width: 50px;
    height: 50px;
    filter: invert(100%);
  }
}

.toggle::after {
   content: '';
   position: absolute;
   
   width: 50px;
   height: 50px;
  background-color: #f7f7f7;
   mix-blend-mode: difference;
   color: white;
}