Procházet zdrojové kódy

update dark mode variables and add support for dark mode in the editor

Ben Dwyer před 4 roky
rodič
revize
af5f16b1ad
2 změnil soubory, kde provedl 6 přidání a 4 odebrání
  1. 5 4
      spearhead/functions.php
  2. 1 0
      spearhead/variables.css

+ 5 - 4
spearhead/functions.php

@@ -20,7 +20,8 @@ if ( ! function_exists( 'spearhead_setup' ) ) :
 	function spearhead_setup() {
 
 		// Add support for editor styles.
-        add_theme_support( 'editor-styles' );
+		add_theme_support( 'editor-styles' );
+		add_theme_support( 'dark-editor-style' );
 
 		// Enqueue editor styles.
 		add_editor_style( array(
@@ -130,7 +131,7 @@ function spearhead_block_extends() {
 	// Block Tweaks
 	wp_enqueue_script( 'spearhead-block-extends',
 		get_stylesheet_directory_uri() . '/assets/js/extend-blocks.js',
-		array( 'wp-blocks', 'wp-edit-post' ) // wp-edit-post is added to avoid a race condition when trying to unregister a style variation 
+		array( 'wp-blocks', 'wp-edit-post' ) // wp-edit-post is added to avoid a race condition when trying to unregister a style variation
 	);
 }
 add_action( 'enqueue_block_assets', 'spearhead_block_extends' );
@@ -150,7 +151,7 @@ function spearhead_fonts_url() : string {
 
     // Make a single request for the theme fonts.
     $fonts_url = 'https://fonts.googleapis.com/css2?' . implode( '&', $font_families );
-    
+
     return $fonts_url;
 }
 
@@ -164,4 +165,4 @@ function seedlet_entry_meta_header() : void {
 		seedlet_posted_on();
 	}
 }
-// require get_stylesheet_directory() . '/inc/custom-header.php';
+// require get_stylesheet_directory() . '/inc/custom-header.php';

+ 1 - 0
spearhead/variables.css

@@ -82,5 +82,6 @@
 		--global--color-foreground: #f0f0f0;
 		--global--color-foreground-light: #ffffff;
 		--global--color-background: #333333;
+		--global--color-text-selection: #000000;
 	}
 }