错误信息组件
使用 Skeuomorphism、Triadic 配色方案和简单布局优化了错误消息组件。使用 Tailwind CSS 制作,以实现响应能力和深色模式支持。无 JavaScript。
HTML 代码
<div class="max-w-md mx-auto p-6 bg-gradient-to-br from-red-500 via-black-500 to-blue-500 text-white font-sans rounded-lg shadow-lg dark:from-red-700 dark:via-black-700 dark:to-blue-700">
<div class="flex items-center space-x-4">
<svg class="h-8 w-8 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
<div class="text-lg font-bold">Error</div>
</div>
<div class="mt-4 text-sm">
<p>An unexpected error occurred. Please try again later.</p>
</div>
</div>