:root { --academy-primary-color: $primary_color; --academy-secondary-color: $secondary_color; --academy-text-color: $text_color; --academy-border-color: $border_color; --academy-gray-color: $gray_color; --academy-surface-color: $surface_color; } .academy-lessons[data-academy-theme=\"dark\"]:not([data-academy-user-theme=\"light\"]), .academy-lessons[data-academy-user-theme=\"dark\"], .academy-course-curriculum-wrapper[data-academy-theme=\"dark\"]:not([data-academy-user-theme=\"light\"]), .academy-course-curriculum-wrapper[data-academy-user-theme=\"dark\"], body[data-academy-theme=\"dark\"]:not([data-academy-user-theme=\"light\"]), body[data-academy-user-theme=\"dark\"] { --academy-primary-color: $dark_primary_color; --academy-secondary-color: $dark_secondary_color; --academy-text-color: $dark_text_color; --academy-border-color: $dark_border_color; --academy-gray-color: $dark_gray_color; --academy-surface-color: $dark_surface_color; --academy-text-color-black: $dark_text_color_black; --academy-secondary-gray-color: $dark_secondary_gray_color; --academy-dark-gray-color: $dark_gray_color_muted; --academy-background-gray-color: $dark_background_gray_color; /* * The light-mode shadow color (near-black at low opacity) * all but vanishes against an already near-black dark * surface. Pure black at higher opacity keeps it visible — * it still reads as a darkening vignette against the dark * palette's surfaces, it just needs more * contrast to do it than on a white background. */ --academy-drawer-shadow-color: rgba(0, 0, 0, 0.55); --academy-shadow-soft: none; --academy-shadow-hard: none; --academy-shadow-overlay: 0 8px 24px -8px rgba(0, 0, 0, 0.6); --academy-success-color: #34d399; --academy-danger-color: #f87171; --academy-warning-color: #fbbf24; --academy-heading-color: var(--academy-text-color-black); --academy-description-color: var(--academy-secondary-gray-color); --academy-icon-inactive-color: var(--academy-dark-gray-color); --academy-accent-color: var(--academy-primary-color); --academy-primary-light-color: var(--academy-secondary-color); --academy-divider-color: var(--academy-border-color); --academy-placeholder-background: var(--academy-gray-color); --academy-body-background-color: var(--academy-background-gray-color); } /* *
itself was never given a background (only the CSS * variables above, which the wrap/content elements consume), * so any part of the viewport taller than the wrap fell back * to the theme's own (usually white) body background instead * of Academy's page canvas color — a transparent makes * the UA paint the viewport canvas from 's background * per spec, so setting it here closes that gap. Reads the * variable rather than a light/dark literal so it stays in * sync with whichever palette is active (the dark override * above already redefines it when dark mode is on) — one * rule instead of duplicating the light/dark selector split. * Scoped to the course-single body class (present on both the * React and PHP curriculum render paths) so no other * frontend page's background is touched. */ body.single-academy_courses { background-color: var(--academy-background-gray-color); } "; // Backend (wp-admin) dark mode — gated to Academy's own admin screens only, so // the #wpcontent/#wpbody-content override below never bleeds into other // plugins' admin pages. Scoped to (not or #academywrap): // #academywrap is a DESCENDANT of #wpcontent/#wpbody-content, not an ancestor, // so a selector on #academywrap can't restyle its own parents — and // doesn't exist yet when this runs (admin_head fires inside ), so the // bootstrap script below targets document.documentElement (, available // immediately) to avoid a flash of light mode on every page load. See // openspec/changes/backend-dashboard-dark-mode/design.md decision 2. if ( is_admin() && Helper::is_academy_admin_page() ) { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo " "; }//end if } }