: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; } "; // 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 " "; } } }