feat: add CHRNX shell and theme preference
This commit is contained in:
18 files changed
+633
-16
No files matched your search
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "chrnx/site-brand",
|
||||
"version": "0.1.0",
|
||||
"title": "CHRNX Site Brand",
|
||||
"category": "theme",
|
||||
"description": "Display the local CHRNX wordmark linked to the site home.",
|
||||
"textdomain": "chrnx",
|
||||
"supports": { "html": false },
|
||||
"render": "file:./render.php"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Render the portable CHRNX site brand and localized skip link.
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
|
||||
$chrnx_home_url = home_url( '/' );
|
||||
$chrnx_wordmark_url = get_theme_file_uri( 'assets/icons/chrnx-wordmark.svg' );
|
||||
?>
|
||||
<a class="chrnx-skip-link" href="#chrnx-main"><?php esc_html_e( 'Skip to content', 'chrnx' ); ?></a>
|
||||
<a
|
||||
<?php
|
||||
// WordPress escapes each generated wrapper attribute.
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo get_block_wrapper_attributes( array( 'class' => 'chrnx-site-brand' ) );
|
||||
?>
|
||||
href="<?php echo esc_url( $chrnx_home_url ); ?>"
|
||||
aria-label="<?php esc_attr_e( 'CHRNX home', 'chrnx' ); ?>"
|
||||
>
|
||||
<img src="<?php echo esc_url( $chrnx_wordmark_url ); ?>" alt="<?php esc_attr_e( 'CHRNX', 'chrnx' ); ?>" width="250" height="64">
|
||||
</a>
|
||||
@@ -20,7 +20,8 @@ $chrnx_control_name = wp_unique_id( 'chrnx-theme-' );
|
||||
?>
|
||||
data-status-light="<?php esc_attr_e( 'Light theme active', 'chrnx' ); ?>"
|
||||
data-status-dark="<?php esc_attr_e( 'Dark theme active', 'chrnx' ); ?>"
|
||||
data-status-system="<?php esc_attr_e( 'following system', 'chrnx' ); ?>"
|
||||
data-status-system-light="<?php esc_attr_e( 'Light theme active, following system preference', 'chrnx' ); ?>"
|
||||
data-status-system-dark="<?php esc_attr_e( 'Dark theme active, following system preference', 'chrnx' ); ?>"
|
||||
>
|
||||
<legend><?php esc_html_e( 'Color theme', 'chrnx' ); ?></legend>
|
||||
<label><input type="radio" name="<?php echo esc_attr( $chrnx_control_name ); ?>" value="light"> <?php esc_html_e( 'Light', 'chrnx' ); ?></label>
|
||||
@@ -28,3 +29,4 @@ $chrnx_control_name = wp_unique_id( 'chrnx-theme-' );
|
||||
<label><input type="radio" name="<?php echo esc_attr( $chrnx_control_name ); ?>" value="system" checked> <?php esc_html_e( 'System', 'chrnx' ); ?></label>
|
||||
<output data-chrnx-theme-status aria-live="polite"><?php esc_html_e( 'Following system theme', 'chrnx' ); ?></output>
|
||||
</fieldset>
|
||||
<noscript><p class="chrnx-theme-noscript"><?php esc_html_e( 'Enable JavaScript to choose a color theme.', 'chrnx' ); ?></p></noscript>
|
||||
Reference in new issue
Block a user