UNPKG

rinshad-react-guard

Version:

A robust React error boundary solution developed by [rinshad.com](https://rinshad.com) to elegantly handle runtime errors in React applications. Instead of showing the dreaded white screen of death, this library captures errors and displays a user-friendl

89 lines (72 loc) 1.72 kB
.error-container { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f8f9fa; /* Light background for contrast */ } .error-content { text-align: center; } .error-500 { position: relative; } .error-500 .title { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 20rem; color: #6c757d; /* Muted text color */ margin: 0; } .error-500-img { position: absolute; left: 50%; transform: translateX(-50%); width: 100%; /* Full width for responsiveness */ max-width: 23.9375rem; /* Maximum width to maintain aspect ratio */ } .error-message { margin-top: 40px; } .error-message h4 { font-size: 24px; color: #343a40; /* Dark text color */ } .error-message p { color: #6c757d; /* Muted text color */ } .back-home { display: inline-block; padding: 10px 20px; margin-top: 15px; background-color: #28a745; /* Success color */ color: white; text-decoration: none; border-radius: 5px; transition: background-color 0.3s; } .back-home:hover { background-color: #218838; color: white; } /* Responsive styles */ @media (max-width: 991.98px) { .error-500 .title { font-size: 150px; /* Reduce size for tablets */ } .error-500-img { top: 15px; /* Adjust position */ } } @media (max-width: 767.98px) { .error-500 .title { font-size: 68px; /* Reduce size for mobile */ margin-top: 20px; /* Adjust margin */ } .error-500-img { position: relative; top: 0; /* Adjust position */ } .error-message h4 { font-size: 20px; /* Adjust heading size */ } }