[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentytwentyone/classes/ -> class-twenty-twenty-one-dark-mode.php (summary)

Dark Mode Class

File Size: 384 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Twenty_Twenty_One_Dark_Mode:: (12 methods):
  __construct()
  editor_custom_color_variables()
  enqueue_scripts()
  customize_controls_enqueue_scripts()
  customizer_controls()
  html_classes()
  admin_body_classes()
  switch_should_render()
  the_switch()
  the_html()
  the_script()
  add_privacy_policy_content()


Class: Twenty_Twenty_One_Dark_Mode  - X-Ref

This class is in charge of Dark Mode.

__construct()   X-Ref
Instantiate the object.

since: Twenty Twenty-One 1.0

editor_custom_color_variables()   X-Ref
Editor custom color variables & scripts.

since: Twenty Twenty-One 1.0
return: void

enqueue_scripts()   X-Ref
Enqueue scripts and styles.

since: Twenty Twenty-One 1.0
return: void

customize_controls_enqueue_scripts()   X-Ref
Enqueue scripts for the customizer.

since: Twenty Twenty-One 1.0
return: void

customizer_controls( $wp_customize )   X-Ref
Register customizer options.

since: Twenty Twenty-One 1.0
param: WP_Customize_Manager $wp_customize Theme Customizer object.
return: void

html_classes( $classes )   X-Ref
Calculate classes for the main <html> element.

since: Twenty Twenty-One 1.0
param: string $classes The classes for <html> element.
return: string

admin_body_classes( $classes )   X-Ref
Adds a class to the <body> element in the editor to accommodate dark-mode.

since: Twenty Twenty-One 1.0
param: string $classes The admin body-classes.
return: string

switch_should_render()   X-Ref
Determine if we want to print the dark-mode switch or not.

since: Twenty Twenty-One 1.0
return: bool

the_switch()   X-Ref
Add night/day switch.

since: Twenty Twenty-One 1.0
return: void

the_html( $attrs = array()   X-Ref
Print the dark-mode switch HTML.

Inspired from https://codepen.io/aaroniker/pen/KGpXZo (MIT-licensed)

since: Twenty Twenty-One 1.0
param: array $attrs The attributes to add to our <button> element.
return: void

the_script()   X-Ref
Print the dark-mode switch script.

since: Twenty Twenty-One 1.0
return: void

add_privacy_policy_content()   X-Ref
Adds information to the privacy policy.

since: Twenty Twenty-One 1.0
return: void



Generated: Mon Aug 2 01:00:04 2021 Cross-referenced by PHPXref 0.7.1