Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy
CSS

CSS: Create Neumorphism with Box Shadows

- 25.07.26 - ErcanOPAK

🟣 Neumorphism = Soft UI Design

Neumorphism blends skeuomorphism and flat design. Box shadows create the soft, extruded look that makes UIs feel tactile and modern.

📝 Neumorphism Components

// Neumorphism Base
.neumorph {
    background: #e0e5ec;
    border-radius: 16px;
    box-shadow: 
        8px 8px 16px rgba(163,177,198,0.6),
        -8px -8px 16px rgba(255,255,255,0.5);
}

// Neumorphism Inset (Pressed)
.neumorph-inset {
    background: #e0e5ec;
    border-radius: 16px;
    box-shadow: 
        inset 8px 8px 16px rgba(163,177,198,0.6),
        inset -8px -8px 16px rgba(255,255,255,0.5);
}

// Neumorphism Card
.neumorph-card {
    background: #e0e5ec;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 
        12px 12px 24px rgba(163,177,198,0.6),
        -12px -12px 24px rgba(255,255,255,0.5);
    transition: all 0.3s ease;
}

.neumorph-card:hover {
    box-shadow: 
        6px 6px 12px rgba(163,177,198,0.6),
        -6px -6px 12px rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

// Neumorphism Button
.neumorph-button {
    background: #e0e5ec;
    border: none;
    border-radius: 50px;
    padding: 12px 32px;
    font-weight: 600;
    color: #2c3e50;
    box-shadow: 
        6px 6px 12px rgba(163,177,198,0.6),
        -6px -6px 12px rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.15s ease;
}

.neumorph-button:active {
    box-shadow: 
        inset 6px 6px 12px rgba(163,177,198,0.6),
        inset -6px -6px 12px rgba(255,255,255,0.5);
    transform: scale(0.98);
}

// Colored Neumorphism
.blue-neumorph {
    background: #d4e4f7;
    box-shadow: 
        8px 8px 16px rgba(139, 178, 227, 0.6),
        -8px -8px 16px rgba(255, 255, 255, 0.5);
}

// Dark Mode Neumorphism
.dark-neumorph {
    background: #2d3748;
    box-shadow: 
        8px 8px 16px rgba(0,0,0,0.4),
        -8px -8px 16px rgba(255,255,255,0.05);
}

🎯 Interactive Neumorphism

// Toggle Switch Neumorphism
.neumorph-toggle {
    display: inline-block;
    width: 60px;
    height: 30px;
    background: #e0e5ec;
    border-radius: 30px;
    box-shadow: 
        inset 3px 3px 6px rgba(163,177,198,0.6),
        inset -3px -3px 6px rgba(255,255,255,0.5);
    position: relative;
    cursor: pointer;
}

.neumorph-toggle .slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: #e0e5ec;
    border-radius: 50%;
    box-shadow: 
        3px 3px 6px rgba(163,177,198,0.6),
        -3px -3px 6px rgba(255,255,255,0.5);
    transition: all 0.3s ease;
}

.neumorph-toggle.active .slider {
    left: 33px;
    background: #4CAF50;
}

// Neumorphism Gallery
.neumorph-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 30px;
    padding: 30px;
}

.neumorph-item {
    background: #e0e5ec;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 
        6px 6px 12px rgba(163,177,198,0.6),
        -6px -6px 12px rgba(255,255,255,0.5);
}

// Loading Spinner Neumorphism
.neumorph-spinner {
    width: 50px;
    height: 50px;
    background: #e0e5ec;
    border-radius: 50%;
    box-shadow: 
        inset 4px 4px 8px rgba(163,177,198,0.6),
        inset -4px -4px 8px rgba(255,255,255,0.5);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

// Neumorphism Form
.neumorph-input {
    background: #e0e5ec;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 
        inset 4px 4px 8px rgba(163,177,198,0.6),
        inset -4px -4px 8px rgba(255,255,255,0.5);
    font-size: 16px;
    outline: none;
    width: 100%;
}

.neumorph-input:focus {
    box-shadow: 
        inset 4px 4px 12px rgba(163,177,198,0.8),
        inset -4px -4px 12px rgba(255,255,255,0.3);
}

💡 Neumorphism Best Practices

  • Use subtle shadows for a soft look
  • Choose appropriate background colors
  • Maintain accessibility with contrast
  • Use insets for pressed/active states
  • Keep consistency across the UI

Neumorphism creates a unique tactile experience. The soft shadows make interfaces feel physical and approachable.

— UI Designer

Related posts:

CSS: Fix Container Queries Never Triggering Because the Parent Element Was Never Given an Explicit c...

CSS: Fix Container Queries Never Triggering Because the Parent Element Was Never Given an Explicit c...

CSS: Container Queries - The End of Media Queries?

CSS: Container Queries - The End of Media Queries?

CSS: Master Overflow for Content Handling

CSS: Master Overflow for Content Handling

Views: 14

Post navigation

Windows 11: Automate Clipboard with PowerToys
HTML: Build Accessible Navigation with Semantic Elements

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (980)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (653)
  • Add Constraint to SQL Table to ensure email contains @ (609)
  • Average of all values in a column that are not zero in SQL (570)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (547)
  • Find numbers with more than two decimal places in SQL (475)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (980)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com