[ 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: 412 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.

return: void
since: Twenty Twenty-One 1.0

enqueue_scripts()   X-Ref
Enqueue scripts and styles.

return: void
since: Twenty Twenty-One 1.0

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

return: void
since: Twenty Twenty-One 1.0

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

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

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

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

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

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

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

return: bool
since: Twenty Twenty-One 1.0

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

return: void
since: Twenty Twenty-One 1.0

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

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

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

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

return: void
since: Twenty Twenty-One 1.0

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

return: void
since: Twenty Twenty-One 1.0



Generated: Sun Apr 18 01:00:12 2021 Cross-referenced by PHPXref 0.7.1