Skip to content

Commit ce13aa6

Browse files
ferr079claude
andcommitted
fix: status page CSS — use is:global for JS-created elements
Astro scopes <style> with data attributes, but dynamically created DOM elements don't get those attributes. Split into scoped (static HTML) and is:global (service cards, node cards, bars, dots). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent be933df commit ce13aa6

2 files changed

Lines changed: 32 additions & 18 deletions

File tree

src/pages/fr/status.astro

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ import SectionHeading from '../../components/SectionHeading.astro';
208208
.summary-grid { display: flex; justify-content: center; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
209209
.summary-card { display: flex; align-items: center; gap: 0.5rem; }
210210
.summary-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-text-muted); flex-shrink: 0; }
211-
.summary-dot.healthy { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); animation: pulse-dot 2s ease-in-out infinite; }
212-
.summary-dot.degraded { background: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.6); animation: pulse-dot 2s ease-in-out infinite; }
213-
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
214211
.summary-value { font-family: var(--font-mono); font-size: 1.75rem; font-weight: 800; color: var(--color-accent); }
215212
.summary-total { color: var(--color-text-muted); font-weight: 400; }
216213
.summary-sep { font-family: var(--font-mono); font-size: 1.5rem; color: var(--color-border); }
@@ -221,9 +218,23 @@ import SectionHeading from '../../components/SectionHeading.astro';
221218
.skeleton-card { height: 2.5rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; animation: skeleton-pulse 1.5s ease-in-out infinite; }
222219
.skeleton-nodes { grid-template-columns: repeat(3, 1fr); }
223220
.skeleton-node { height: 8rem; }
224-
@keyframes skeleton-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
225221
.status-waiting { text-align: center; color: var(--color-text-muted); font-family: var(--font-mono); font-size: 0.85rem; margin-top: 1.5rem; }
226222
.status-loading { padding: 1rem 0; }
223+
.status-footer { padding: 2rem 0; }
224+
.status-note { font-size: 0.8rem; color: var(--color-text-muted); text-align: center; font-family: var(--font-mono); }
225+
226+
@media (max-width: 640px) {
227+
.summary-grid { gap: 1.5rem; }
228+
.summary-value { font-size: 1.25rem; }
229+
}
230+
</style>
231+
232+
<style is:global>
233+
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
234+
@keyframes skeleton-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
235+
236+
.summary-dot.healthy { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); animation: pulse-dot 2s ease-in-out infinite; }
237+
.summary-dot.degraded { background: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.6); animation: pulse-dot 2s ease-in-out infinite; }
227238

228239
.service-category { margin-bottom: 2rem; }
229240
.category-title { font-family: var(--font-mono); font-size: 0.9rem; color: var(--color-accent); margin-bottom: 0.75rem; letter-spacing: 0.05em; }
@@ -248,12 +259,7 @@ import SectionHeading from '../../components/SectionHeading.astro';
248259
.node-uptime { font-family: var(--font-mono); font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.5rem; }
249260
.node-offline { font-family: var(--font-mono); font-size: 0.85rem; color: var(--color-text-muted); font-style: italic; }
250261

251-
.status-footer { padding: 2rem 0; }
252-
.status-note { font-size: 0.8rem; color: var(--color-text-muted); text-align: center; font-family: var(--font-mono); }
253-
254262
@media (max-width: 640px) {
255-
.summary-grid { gap: 1.5rem; }
256-
.summary-value { font-size: 1.25rem; }
257263
.nodes-grid { grid-template-columns: 1fr; }
258264
.service-grid { grid-template-columns: 1fr; }
259265
}

src/pages/status.astro

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,11 @@ import SectionHeading from '../components/SectionHeading.astro';
204204
</script>
205205

206206
<style>
207+
/* Static elements (Astro-scoped) */
207208
.status-summary { padding: 2rem 0; border-bottom: 1px solid var(--color-border); }
208209
.summary-grid { display: flex; justify-content: center; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
209210
.summary-card { display: flex; align-items: center; gap: 0.5rem; }
210211
.summary-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-text-muted); flex-shrink: 0; }
211-
.summary-dot.healthy { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); animation: pulse-dot 2s ease-in-out infinite; }
212-
.summary-dot.degraded { background: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.6); animation: pulse-dot 2s ease-in-out infinite; }
213-
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
214212
.summary-value { font-family: var(--font-mono); font-size: 1.75rem; font-weight: 800; color: var(--color-accent); }
215213
.summary-total { color: var(--color-text-muted); font-weight: 400; }
216214
.summary-sep { font-family: var(--font-mono); font-size: 1.5rem; color: var(--color-border); }
@@ -221,9 +219,24 @@ import SectionHeading from '../components/SectionHeading.astro';
221219
.skeleton-card { height: 2.5rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; animation: skeleton-pulse 1.5s ease-in-out infinite; }
222220
.skeleton-nodes { grid-template-columns: repeat(3, 1fr); }
223221
.skeleton-node { height: 8rem; }
224-
@keyframes skeleton-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
225222
.status-waiting { text-align: center; color: var(--color-text-muted); font-family: var(--font-mono); font-size: 0.85rem; margin-top: 1.5rem; }
226223
.status-loading { padding: 1rem 0; }
224+
.status-footer { padding: 2rem 0; }
225+
.status-note { font-size: 0.8rem; color: var(--color-text-muted); text-align: center; font-family: var(--font-mono); }
226+
227+
@media (max-width: 640px) {
228+
.summary-grid { gap: 1.5rem; }
229+
.summary-value { font-size: 1.25rem; }
230+
}
231+
</style>
232+
233+
<style is:global>
234+
/* Dynamic elements (created by JS — must be global) */
235+
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
236+
@keyframes skeleton-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
237+
238+
.summary-dot.healthy { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); animation: pulse-dot 2s ease-in-out infinite; }
239+
.summary-dot.degraded { background: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.6); animation: pulse-dot 2s ease-in-out infinite; }
227240

228241
.service-category { margin-bottom: 2rem; }
229242
.category-title { font-family: var(--font-mono); font-size: 0.9rem; color: var(--color-accent); margin-bottom: 0.75rem; letter-spacing: 0.05em; }
@@ -248,12 +261,7 @@ import SectionHeading from '../components/SectionHeading.astro';
248261
.node-uptime { font-family: var(--font-mono); font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.5rem; }
249262
.node-offline { font-family: var(--font-mono); font-size: 0.85rem; color: var(--color-text-muted); font-style: italic; }
250263

251-
.status-footer { padding: 2rem 0; }
252-
.status-note { font-size: 0.8rem; color: var(--color-text-muted); text-align: center; font-family: var(--font-mono); }
253-
254264
@media (max-width: 640px) {
255-
.summary-grid { gap: 1.5rem; }
256-
.summary-value { font-size: 1.25rem; }
257265
.nodes-grid { grid-template-columns: 1fr; }
258266
.service-grid { grid-template-columns: 1fr; }
259267
}

0 commit comments

Comments
 (0)