DEV Community

Cover image for Create Claymorphism Using CSS
Dhairya Shah
Dhairya Shah

Posted on β€’ Originally published at codewithsnowbit.hashnode.dev

2 3

Create Claymorphism Using CSS

Let's get started

Prerequisites for this project is very low and all our beginner friends can do; All we need is basic knowledge of HTML and CSS

In short, Claymorphism is:
properties.png

Let's add some basic CSS and centre the content

* {
    box-sizing: border-box;
  }

  body {
      margin: 0;
      background: #a2e5ff;
      color: #2D3557;
      font-family: 'Poppins', sans-serif;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
  }
Enter fullscreen mode Exit fullscreen mode

Note: Import Poppins fonts to your project

Now, it's time to create our card in the HTML file

<div class="card">
     <h2 class="card-title">Have you tried Calymorphism</h2>
     <p class="card-text">Calymorphism is awesome!</p>
     <div class="card-button">Yes!</div>
</div>
Enter fullscreen mode Exit fullscreen mode

It's time to make it look beautiful 🌈

.card {
    width: 400px;
    padding: 50px;
    border-radius: 30px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 35px 68px 0 rgba(0, 94, 182, 0.42) 
  }
  .card-title {
    font-size: 32px;
    margin: 0  0 8px 0;
    line-height: 1.3;
    font-weight: 600;
  }
  .card-text {
    font-size: 20px;
    margin: 0;
    line-height: 1.3;
  }
.card-button{
    font-size: 20px;
    font-weight: 900;
    margin-top: 10px;
    background: #2D3557;
    color: #ffffff;
    padding: 5px;
    border-radius: 30px;
    border: none;
    box-shadow: 0 17px 34px 0 rgba(0, 94, 182, 0.42);
    text-transform: uppercase;
    cursor: pointer;
  }
Enter fullscreen mode Exit fullscreen mode

Tada πŸŽ‰ You created a card
output

Now, its time to transform it to Claymorphism

.card{
    ...
    box-shadow: 0 35px 68px 0 rgba(0, 94, 182, 0.42), inset 0 -8px 16px 0 #4688ec;
    ...
}
.card-button{
     ...
     box-shadow: 0 17px 34px 0 rgba(0, 94, 182, 0.42), inset 0 10px 26px 0 #24477c;
     ...
}
.card-button:hover{
    background: #2D3557;
    color: #ffffff;
    box-shadow: 0 17px 34px 0 rgba(0, 94, 182, 0.42), inset 0 20px 26px 0 #24477c;
  }
Enter fullscreen mode Exit fullscreen mode

output
You made it πŸŽ‰


Thank you for reading, have a nice day!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay