feat(Production): Complete production deployment infrastructure

- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
This commit is contained in:
2025-10-25 19:18:37 +02:00
parent caa85db796
commit fc3d7e6357
83016 changed files with 378904 additions and 20919 deletions

View File

@@ -0,0 +1,527 @@
/**
* Component Playground Styles
*
* Interactive development tool for LiveComponents.
* Modern, responsive UI with code editor aesthetics.
*
* Features:
* - Component browser with search
* - JSON state editor with syntax highlighting
* - Live component preview
* - Action testing interface
* - Performance metrics display
* - Code generator with copy-to-clipboard
*/
@layer components {
/* ========================================
Layout & Container
======================================== */
.playground {
min-height: 100vh;
background: oklch(98% 0.01 280);
font-family: system-ui, -apple-system, sans-serif;
}
.playground__header {
padding: 2rem;
background: oklch(100% 0 0);
border-bottom: 1px solid oklch(90% 0.01 280);
}
.playground__title {
font-size: 2rem;
font-weight: 700;
color: oklch(20% 0.02 280);
margin: 0 0 0.5rem 0;
}
.playground__subtitle {
font-size: 1rem;
color: oklch(50% 0.05 280);
margin: 0;
}
.playground__layout {
display: grid;
grid-template-columns: 320px 1fr;
gap: 0;
min-height: calc(100vh - 120px);
}
/* ========================================
Sidebar: Component Selector
======================================== */
.playground__sidebar {
background: oklch(100% 0 0);
border-right: 1px solid oklch(90% 0.01 280);
display: flex;
flex-direction: column;
}
.playground__search {
padding: 1rem;
border-bottom: 1px solid oklch(90% 0.01 280);
}
.playground__search-input {
width: 100%;
padding: 0.75rem 1rem;
border: 1px solid oklch(85% 0.01 280);
border-radius: 0.5rem;
font-size: 0.875rem;
transition: border-color 0.2s;
&:focus {
outline: none;
border-color: oklch(60% 0.2 280);
box-shadow: 0 0 0 3px oklch(90% 0.1 280 / 0.3);
}
}
.playground__component-list {
flex: 1;
overflow-y: auto;
padding: 0.5rem;
}
.playground__component-item {
padding: 1rem;
margin-bottom: 0.5rem;
background: oklch(98% 0.01 280);
border: 1px solid oklch(90% 0.01 280);
border-radius: 0.5rem;
cursor: pointer;
transition: all 0.2s;
&:hover {
background: oklch(95% 0.01 280);
border-color: oklch(80% 0.05 280);
transform: translateX(4px);
}
&--active {
background: oklch(85% 0.15 280);
border-color: oklch(60% 0.2 280);
box-shadow: 0 2px 8px oklch(60% 0.2 280 / 0.2);
&:hover {
transform: none;
}
}
}
.playground__component-name {
font-weight: 600;
color: oklch(20% 0.02 280);
margin-bottom: 0.5rem;
font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}
.playground__component-meta {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.playground__badge {
display: inline-block;
padding: 0.25rem 0.5rem;
background: oklch(92% 0.01 280);
color: oklch(40% 0.05 280);
border-radius: 0.25rem;
font-size: 0.75rem;
font-weight: 500;
&--cache {
background: oklch(85% 0.15 140);
color: oklch(30% 0.1 140);
}
}
/* ========================================
Main Content Area
======================================== */
.playground__main {
padding: 2rem;
overflow-y: auto;
}
.playground__section {
margin-bottom: 3rem;
background: oklch(100% 0 0);
border: 1px solid oklch(90% 0.01 280);
border-radius: 0.75rem;
padding: 1.5rem;
box-shadow: 0 1px 3px oklch(0% 0 0 / 0.05);
}
.playground__section-title {
font-size: 1.25rem;
font-weight: 600;
color: oklch(20% 0.02 280);
margin: 0 0 1rem 0;
padding-bottom: 0.75rem;
border-bottom: 1px solid oklch(90% 0.01 280);
}
/* ========================================
State Editor
======================================== */
.playground__state-editor {
display: flex;
flex-direction: column;
gap: 1rem;
}
.playground__textarea {
width: 100%;
padding: 1rem;
border: 1px solid oklch(85% 0.01 280);
border-radius: 0.5rem;
font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
font-size: 0.875rem;
line-height: 1.5;
background: oklch(98% 0.01 280);
color: oklch(20% 0.02 280);
resize: vertical;
min-height: 200px;
&:focus {
outline: none;
border-color: oklch(60% 0.2 280);
box-shadow: 0 0 0 3px oklch(90% 0.1 280 / 0.3);
}
}
.playground__editor-actions {
display: flex;
gap: 0.75rem;
flex-wrap: wrap;
}
.playground__validation {
padding: 0.75rem;
border-radius: 0.5rem;
font-size: 0.875rem;
min-height: 2.5rem;
display: flex;
align-items: center;
}
.playground__success {
color: oklch(35% 0.15 140);
font-weight: 500;
}
.playground__error {
color: oklch(50% 0.2 30);
font-weight: 500;
}
/* ========================================
Buttons
======================================== */
.playground__button {
padding: 0.75rem 1.5rem;
background: oklch(95% 0.01 280);
color: oklch(30% 0.05 280);
border: 1px solid oklch(85% 0.01 280);
border-radius: 0.5rem;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
&:hover {
background: oklch(92% 0.01 280);
border-color: oklch(80% 0.05 280);
}
&:active {
transform: translateY(1px);
}
&:focus {
outline: none;
box-shadow: 0 0 0 3px oklch(90% 0.1 280 / 0.3);
}
&--primary {
background: oklch(60% 0.2 280);
color: oklch(100% 0 0);
border-color: oklch(60% 0.2 280);
&:hover {
background: oklch(55% 0.2 280);
border-color: oklch(55% 0.2 280);
}
}
&--action {
font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
background: oklch(85% 0.15 140);
color: oklch(25% 0.1 140);
border-color: oklch(75% 0.15 140);
&:hover {
background: oklch(80% 0.15 140);
border-color: oklch(70% 0.15 140);
}
}
}
/* ========================================
Live Preview
======================================== */
.playground__preview {
min-height: 300px;
padding: 2rem;
background: oklch(98% 0.01 280);
border: 1px dashed oklch(85% 0.01 280);
border-radius: 0.5rem;
margin-bottom: 1rem;
}
/* ========================================
Performance Metrics
======================================== */
.playground__metrics {
padding: 1rem;
background: oklch(95% 0.01 280);
border-radius: 0.5rem;
border: 1px solid oklch(90% 0.01 280);
}
.playground__metrics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 1rem;
}
.playground__metric {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.playground__metric-label {
font-size: 0.75rem;
color: oklch(50% 0.05 280);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.playground__metric-value {
font-size: 1.5rem;
font-weight: 700;
color: oklch(20% 0.02 280);
font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}
/* ========================================
Actions
======================================== */
.playground__actions {
display: flex;
flex-direction: column;
gap: 1rem;
}
.playground__action {
padding: 1rem;
background: oklch(98% 0.01 280);
border: 1px solid oklch(90% 0.01 280);
border-radius: 0.5rem;
}
.playground__action-params {
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid oklch(90% 0.01 280);
display: flex;
flex-direction: column;
gap: 0.75rem;
label {
display: flex;
flex-direction: column;
gap: 0.5rem;
font-size: 0.875rem;
color: oklch(30% 0.05 280);
font-weight: 500;
}
input {
padding: 0.75rem;
border: 1px solid oklch(85% 0.01 280);
border-radius: 0.5rem;
font-size: 0.875rem;
&:focus {
outline: none;
border-color: oklch(60% 0.2 280);
box-shadow: 0 0 0 3px oklch(90% 0.1 280 / 0.3);
}
}
}
/* ========================================
Code Generator
======================================== */
.playground__code-generator {
display: flex;
flex-direction: column;
gap: 1rem;
}
.playground__code {
padding: 1.5rem;
background: oklch(15% 0.01 280);
color: oklch(90% 0.05 140);
border-radius: 0.5rem;
font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
font-size: 0.875rem;
line-height: 1.6;
overflow-x: auto;
margin: 0;
code {
color: inherit;
background: none;
}
}
/* ========================================
Empty States & Loading
======================================== */
.playground__empty {
padding: 3rem;
text-align: center;
color: oklch(60% 0.05 280);
font-size: 0.875rem;
}
.playground__loading {
padding: 2rem;
text-align: center;
color: oklch(50% 0.05 280);
font-size: 0.875rem;
&::after {
content: '';
display: inline-block;
width: 1rem;
height: 1rem;
margin-left: 0.5rem;
border: 2px solid oklch(80% 0.05 280);
border-top-color: oklch(60% 0.2 280);
border-radius: 50%;
animation: playground-spin 0.8s linear infinite;
}
}
@keyframes playground-spin {
to {
transform: rotate(360deg);
}
}
/* ========================================
Responsive Design
======================================== */
@media (max-width: 1024px) {
.playground__layout {
grid-template-columns: 1fr;
}
.playground__sidebar {
border-right: none;
border-bottom: 1px solid oklch(90% 0.01 280);
max-height: 400px;
}
.playground__metrics-grid {
grid-template-columns: 1fr;
}
}
/* ========================================
Dark Mode Support
======================================== */
@media (prefers-color-scheme: dark) {
.playground {
background: oklch(15% 0.01 280);
}
.playground__header,
.playground__sidebar,
.playground__section {
background: oklch(20% 0.01 280);
border-color: oklch(30% 0.01 280);
}
.playground__title {
color: oklch(90% 0.02 280);
}
.playground__subtitle {
color: oklch(70% 0.05 280);
}
.playground__search-input,
.playground__textarea {
background: oklch(15% 0.01 280);
color: oklch(90% 0.02 280);
border-color: oklch(30% 0.01 280);
}
.playground__component-item {
background: oklch(18% 0.01 280);
border-color: oklch(30% 0.01 280);
&:hover {
background: oklch(25% 0.01 280);
}
&--active {
background: oklch(35% 0.15 280);
border-color: oklch(50% 0.2 280);
}
}
.playground__button {
background: oklch(25% 0.01 280);
color: oklch(85% 0.02 280);
border-color: oklch(35% 0.01 280);
&:hover {
background: oklch(30% 0.01 280);
}
}
.playground__preview,
.playground__metrics,
.playground__action {
background: oklch(18% 0.01 280);
border-color: oklch(30% 0.01 280);
}
.playground__metric-value {
color: oklch(90% 0.02 280);
}
}
}

View File

@@ -0,0 +1,546 @@
/**
* File Upload Widget Styles
*
* Complete styling for file upload UI component with:
* - Drag & Drop zone
* - File list with thumbnails/icons
* - Progress indicators
* - Status feedback
* - Dark mode support
* - Responsive design
*
* @package Framework\LiveComponents
*/
@layer components {
/* ===== Widget Container ===== */
.file-upload-widget {
width: 100%;
max-width: 600px;
margin: 0 auto;
}
/* ===== Drop Zone ===== */
.file-upload-dropzone {
position: relative;
border: 2px dashed oklch(70% 0.05 280);
border-radius: 0.75rem;
padding: 2rem;
text-align: center;
background: oklch(98% 0.01 280);
transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
cursor: pointer;
}
.file-upload-dropzone:hover {
border-color: oklch(60% 0.15 280);
background: oklch(96% 0.02 280);
}
.file-upload-dropzone.drag-over,
.file-upload-dropzone.drag-active {
border-color: oklch(60% 0.25 280);
background: oklch(95% 0.08 280 / 0.5);
transform: scale(1.02);
}
.dropzone-content {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
pointer-events: none; /* Allow drag events to pass through */
}
.dropzone-icon {
color: oklch(60% 0.15 280);
opacity: 0.7;
}
.file-upload-dropzone:hover .dropzone-icon,
.file-upload-dropzone.drag-over .dropzone-icon {
opacity: 1;
color: oklch(60% 0.25 280);
}
.dropzone-text {
margin: 0;
color: oklch(40% 0.05 280);
font-size: 1rem;
font-weight: 500;
}
.dropzone-button {
pointer-events: auto;
padding: 0.5rem 1.5rem;
border-radius: 0.5rem;
background: oklch(60% 0.25 280);
color: white;
border: none;
cursor: pointer;
font-weight: 500;
transition: all 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.dropzone-button:hover {
background: oklch(55% 0.25 280);
transform: translateY(-2px);
}
.dropzone-button:active {
transform: translateY(0);
}
.dropzone-input {
position: absolute;
opacity: 0;
pointer-events: none;
}
/* ===== File List ===== */
.file-upload-list {
margin-top: 1.5rem;
border: 1px solid oklch(85% 0.02 280);
border-radius: 0.75rem;
padding: 1rem;
background: oklch(99% 0.005 280);
}
.file-list-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid oklch(90% 0.02 280);
}
.file-list-header h4 {
margin: 0;
font-size: 1rem;
font-weight: 600;
color: oklch(30% 0.05 280);
}
.file-list-actions {
display: flex;
gap: 0.5rem;
}
.file-list-items {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
/* ===== File Item ===== */
.file-item {
display: grid;
grid-template-columns: auto 1fr auto;
gap: 1rem;
align-items: start;
padding: 0.75rem;
border: 1px solid oklch(90% 0.02 280);
border-radius: 0.5rem;
background: white;
transition: all 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.file-item:hover {
border-color: oklch(80% 0.05 280);
box-shadow: 0 2px 8px oklch(50% 0.05 280 / 0.08);
}
/* File item states */
.file-item.file-uploading {
border-color: oklch(60% 0.25 280);
background: oklch(98% 0.08 280 / 0.3);
}
.file-item.file-complete {
border-color: oklch(70% 0.15 140);
background: oklch(98% 0.08 140 / 0.2);
}
.file-item.file-error {
border-color: oklch(65% 0.2 30);
background: oklch(98% 0.08 30 / 0.2);
}
/* ===== File Preview ===== */
.file-preview {
width: 56px;
height: 56px;
border-radius: 0.375rem;
overflow: hidden;
background: oklch(95% 0.02 280);
display: flex;
align-items: center;
justify-content: center;
}
.file-thumbnail {
width: 100%;
height: 100%;
object-fit: cover;
}
.file-icon {
color: oklch(60% 0.1 280);
}
/* ===== File Info ===== */
.file-info {
flex: 1;
min-width: 0; /* Allow text truncation */
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.file-name {
font-weight: 500;
color: oklch(25% 0.05 280);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.file-meta {
display: flex;
gap: 0.75rem;
align-items: center;
font-size: 0.875rem;
color: oklch(50% 0.05 280);
}
.file-status {
font-weight: 500;
}
.file-status[data-status="pending"] {
color: oklch(50% 0.1 280);
}
.file-status[data-status="uploading"] {
color: oklch(60% 0.25 280);
}
.file-status[data-status="complete"] {
color: oklch(60% 0.15 140);
}
.file-status[data-status="error"] {
color: oklch(55% 0.2 30);
}
.file-error {
margin-top: 0.25rem;
padding: 0.5rem;
background: oklch(98% 0.08 30 / 0.3);
border-radius: 0.25rem;
font-size: 0.875rem;
color: oklch(45% 0.15 30);
}
/* ===== File Progress ===== */
.file-progress {
display: flex;
align-items: center;
gap: 0.5rem;
margin-top: 0.5rem;
}
.file-progress-bar {
flex: 1;
height: 4px;
background: oklch(90% 0.02 280);
border-radius: 2px;
overflow: hidden;
}
.file-progress-fill {
height: 100%;
background: oklch(60% 0.25 280);
border-radius: 2px;
transition: width 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.file-progress-text {
font-size: 0.75rem;
font-weight: 600;
color: oklch(50% 0.1 280);
min-width: 3ch;
text-align: right;
}
/* ===== File Actions ===== */
.file-actions {
display: flex;
gap: 0.25rem;
}
.btn-icon {
width: 32px;
height: 32px;
padding: 0.5rem;
border: none;
background: transparent;
border-radius: 0.25rem;
color: oklch(50% 0.05 280);
cursor: pointer;
transition: all 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
display: flex;
align-items: center;
justify-content: center;
}
.btn-icon:hover {
background: oklch(95% 0.02 280);
color: oklch(40% 0.1 280);
}
.btn-icon:active {
transform: scale(0.95);
}
/* ===== Overall Progress ===== */
.file-upload-progress {
margin-top: 1rem;
padding: 1rem;
border: 1px solid oklch(85% 0.02 280);
border-radius: 0.5rem;
background: oklch(99% 0.005 280);
}
.progress-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.progress-label {
font-weight: 500;
color: oklch(30% 0.05 280);
}
.progress-percentage {
font-weight: 600;
color: oklch(60% 0.25 280);
font-size: 0.875rem;
}
.progress-bar {
height: 8px;
background: oklch(90% 0.02 280);
border-radius: 4px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, oklch(60% 0.25 280), oklch(70% 0.25 280));
border-radius: 4px;
transition: width 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
/* ===== Button Styles ===== */
.btn {
padding: 0.5rem 1rem;
border-radius: 0.375rem;
font-weight: 500;
font-size: 0.875rem;
cursor: pointer;
border: none;
transition: all 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.btn-primary {
background: oklch(60% 0.25 280);
color: white;
}
.btn-primary:hover {
background: oklch(55% 0.25 280);
transform: translateY(-1px);
}
.btn-secondary {
background: oklch(90% 0.02 280);
color: oklch(40% 0.05 280);
}
.btn-secondary:hover {
background: oklch(85% 0.05 280);
}
.btn-sm {
padding: 0.375rem 0.75rem;
font-size: 0.8125rem;
}
.btn:active {
transform: translateY(0);
}
/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
.file-upload-dropzone {
border-color: oklch(40% 0.05 280);
background: oklch(25% 0.02 280);
}
.file-upload-dropzone:hover,
.file-upload-dropzone.drag-over {
border-color: oklch(60% 0.25 280);
background: oklch(30% 0.08 280);
}
.dropzone-text {
color: oklch(75% 0.05 280);
}
.file-upload-list {
border-color: oklch(35% 0.02 280);
background: oklch(22% 0.02 280);
}
.file-list-header {
border-bottom-color: oklch(30% 0.02 280);
}
.file-list-header h4 {
color: oklch(85% 0.05 280);
}
.file-item {
border-color: oklch(30% 0.02 280);
background: oklch(25% 0.02 280);
}
.file-item:hover {
border-color: oklch(40% 0.05 280);
}
.file-preview {
background: oklch(30% 0.02 280);
}
.file-name {
color: oklch(85% 0.05 280);
}
.file-meta {
color: oklch(65% 0.05 280);
}
.file-error {
background: oklch(35% 0.08 30 / 0.3);
color: oklch(75% 0.15 30);
}
.file-progress-bar {
background: oklch(30% 0.02 280);
}
.file-upload-progress {
border-color: oklch(35% 0.02 280);
background: oklch(22% 0.02 280);
}
.progress-label {
color: oklch(85% 0.05 280);
}
.progress-bar {
background: oklch(30% 0.02 280);
}
.btn-secondary {
background: oklch(30% 0.02 280);
color: oklch(80% 0.05 280);
}
.btn-secondary:hover {
background: oklch(35% 0.05 280);
}
.btn-icon:hover {
background: oklch(30% 0.02 280);
color: oklch(80% 0.1 280);
}
}
/* ===== Responsive Design ===== */
@media (max-width: 640px) {
.file-upload-widget {
max-width: 100%;
}
.file-upload-dropzone {
padding: 1.5rem 1rem;
}
.dropzone-text {
font-size: 0.875rem;
}
.file-item {
grid-template-columns: auto 1fr;
gap: 0.75rem;
}
.file-actions {
grid-column: 1 / -1;
justify-content: flex-end;
padding-top: 0.5rem;
border-top: 1px solid oklch(90% 0.02 280);
}
@media (prefers-color-scheme: dark) {
.file-actions {
border-top-color: oklch(30% 0.02 280);
}
}
.file-list-header {
flex-direction: column;
align-items: flex-start;
gap: 0.75rem;
}
.file-list-actions {
width: 100%;
}
.file-list-actions .btn {
flex: 1;
}
}
/* ===== Animations ===== */
@keyframes upload-pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
.file-item.file-uploading .file-progress-fill {
animation: upload-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
}

View File

@@ -0,0 +1,456 @@
/**
* Skeleton Loader Component
*
* Modern skeleton loading placeholders for lazy-loaded components.
* Uses CSS animations for smooth, performant loading states.
*
* Features:
* - Multiple skeleton types (text, card, list, table, feed)
* - Smooth shimmer animation
* - Responsive design
* - Customizable via CSS custom properties
* - Accessibility-friendly
*/
@layer components {
/* Base Skeleton Styles */
.skeleton {
--skeleton-bg: oklch(95% 0.01 280);
--skeleton-shimmer: oklch(98% 0.01 280);
--skeleton-duration: 1.5s;
--skeleton-radius: 0.5rem;
background: linear-gradient(
90deg,
var(--skeleton-bg) 0%,
var(--skeleton-shimmer) 50%,
var(--skeleton-bg) 100%
);
background-size: 200% 100%;
animation: skeleton-shimmer var(--skeleton-duration) infinite ease-in-out;
border-radius: var(--skeleton-radius);
opacity: 0.7;
/* Accessibility */
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
user-select: none;
pointer-events: none;
}
}
/* Shimmer Animation */
@keyframes skeleton-shimmer {
0% {
background-position: -200% 0;
}
100% {
background-position: 200% 0;
}
}
/* Skeleton Container */
.skeleton-container {
padding: 1.5rem;
background: var(--color-bg, oklch(100% 0 0));
border-radius: var(--skeleton-radius);
border: 1px solid oklch(90% 0.01 280);
min-height: 150px;
position: relative;
overflow: hidden;
/* Loading indicator */
&::after {
content: 'Loading...';
position: absolute;
bottom: 0.75rem;
left: 50%;
transform: translateX(-50%);
font-size: 0.875rem;
color: oklch(60% 0.05 280);
opacity: 0.5;
pointer-events: none;
}
/* Hide loading text when content loads */
&[data-loaded="true"]::after {
display: none;
}
}
/* Text Skeleton */
.skeleton-text {
height: 1rem;
margin-bottom: 0.75rem;
border-radius: 0.25rem;
&:last-child {
margin-bottom: 0;
}
/* Width variants */
&--full {
width: 100%;
}
&--80 {
width: 80%;
}
&--60 {
width: 60%;
}
&--40 {
width: 40%;
}
/* Size variants */
&--lg {
height: 1.5rem;
}
&--sm {
height: 0.75rem;
}
}
/* Card Skeleton */
.skeleton-card {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1.5rem;
background: var(--color-bg, oklch(100% 0 0));
border-radius: var(--skeleton-radius);
border: 1px solid oklch(90% 0.01 280);
&__header {
display: flex;
align-items: center;
gap: 1rem;
}
&__avatar {
width: 48px;
height: 48px;
border-radius: 50%;
flex-shrink: 0;
}
&__title {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
&__image {
width: 100%;
height: 200px;
border-radius: 0.5rem;
}
&__content {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
&__footer {
display: flex;
gap: 1rem;
padding-top: 0.5rem;
border-top: 1px solid oklch(90% 0.01 280);
}
&__action {
height: 2.5rem;
flex: 1;
border-radius: 0.5rem;
}
}
/* List Skeleton */
.skeleton-list {
display: flex;
flex-direction: column;
gap: 1rem;
&__item {
display: flex;
align-items: center;
gap: 1rem;
padding: 1rem;
background: var(--color-bg, oklch(100% 0 0));
border-radius: var(--skeleton-radius);
border: 1px solid oklch(90% 0.01 280);
}
&__icon {
width: 40px;
height: 40px;
border-radius: 0.5rem;
flex-shrink: 0;
}
&__content {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
&__action {
width: 80px;
height: 2rem;
border-radius: 0.5rem;
}
}
/* Table Skeleton */
.skeleton-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
border-radius: var(--skeleton-radius);
overflow: hidden;
border: 1px solid oklch(90% 0.01 280);
&__row {
display: flex;
gap: 1rem;
padding: 1rem;
&:not(:last-child) {
border-bottom: 1px solid oklch(90% 0.01 280);
}
/* Header row */
&--header {
background: oklch(97% 0.01 280);
font-weight: 600;
}
}
&__cell {
flex: 1;
height: 1.5rem;
border-radius: 0.25rem;
&--narrow {
flex: 0 0 100px;
}
&--wide {
flex: 2;
}
}
}
/* Feed Skeleton */
.skeleton-feed {
display: flex;
flex-direction: column;
gap: 1.5rem;
&__item {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1.5rem;
background: var(--color-bg, oklch(100% 0 0));
border-radius: var(--skeleton-radius);
border: 1px solid oklch(90% 0.01 280);
}
&__header {
display: flex;
align-items: center;
gap: 0.75rem;
}
&__avatar {
width: 40px;
height: 40px;
border-radius: 50%;
flex-shrink: 0;
}
&__meta {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.375rem;
}
&__content {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
&__actions {
display: flex;
gap: 1rem;
padding-top: 0.75rem;
border-top: 1px solid oklch(90% 0.01 280);
}
&__action {
width: 80px;
height: 2rem;
border-radius: 0.5rem;
}
}
/* Stats Skeleton */
.skeleton-stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
&__card {
display: flex;
flex-direction: column;
gap: 0.75rem;
padding: 1.5rem;
background: var(--color-bg, oklch(100% 0 0));
border-radius: var(--skeleton-radius);
border: 1px solid oklch(90% 0.01 280);
}
&__label {
height: 1rem;
width: 60%;
border-radius: 0.25rem;
}
&__value {
height: 2.5rem;
width: 80%;
border-radius: 0.5rem;
}
&__trend {
height: 0.875rem;
width: 40%;
border-radius: 0.25rem;
}
}
/* Chart Skeleton */
.skeleton-chart {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1.5rem;
background: var(--color-bg, oklch(100% 0 0));
border-radius: var(--skeleton-radius);
border: 1px solid oklch(90% 0.01 280);
&__title {
height: 1.5rem;
width: 40%;
border-radius: 0.25rem;
}
&__graph {
display: flex;
align-items: flex-end;
gap: 0.5rem;
height: 200px;
padding: 1rem 0;
border-bottom: 2px solid oklch(90% 0.01 280);
}
&__bar {
flex: 1;
border-radius: 0.25rem;
min-height: 40px;
&:nth-child(1) {
height: 60%;
}
&:nth-child(2) {
height: 80%;
}
&:nth-child(3) {
height: 50%;
}
&:nth-child(4) {
height: 90%;
}
&:nth-child(5) {
height: 70%;
}
}
&__legend {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
&__legend-item {
height: 1rem;
width: 80px;
border-radius: 0.25rem;
}
}
/* Responsive adjustments */
@media (max-width: 768px) {
.skeleton-container {
padding: 1rem;
}
.skeleton-card {
padding: 1rem;
&__image {
height: 150px;
}
}
.skeleton-stats {
grid-template-columns: 1fr;
}
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
.skeleton {
--skeleton-bg: oklch(20% 0.01 280);
--skeleton-shimmer: oklch(25% 0.01 280);
}
.skeleton-container,
.skeleton-card,
.skeleton-list__item,
.skeleton-table,
.skeleton-feed__item,
.skeleton-stats__card,
.skeleton-chart {
background: oklch(15% 0.01 280);
border-color: oklch(25% 0.01 280);
}
.skeleton-table__row--header {
background: oklch(18% 0.01 280);
}
}
/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
.skeleton {
animation: none;
opacity: 0.5;
}
}
}