Skip to content

Commit

Permalink
Added Design System Callout style variation to core/header block.
Browse files Browse the repository at this point in the history
  • Loading branch information
ASpiteri-BCGov committed Nov 20, 2024
1 parent 867ec4e commit 84089ab
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Integrate reusable unit tests from WordPress utils ([DESCW-2664](https://apps.itsm.gov.bc.ca/jira/browse/DESCW-2664))
- Added new colors to global color variables ([DSWP-2](https://apps.itsm.gov.bc.ca/jira/browse/DSWP-2))
- Added Design System Callout style variation to core/header block. ([DSWP-52](https://apps.itsm.gov.bc.ca/jira/browse/DSWP-52))

## 1.2.0 October 1, 2024

Expand Down
18 changes: 18 additions & 0 deletions blocks/core/style-overrides/heading.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Registers the heading block styles.
*
* @since 1.3.0
*/
function register_heading_block_styles() {
$block_name = 'core/heading';
$style_properties = array(
'name' => 'wp-block-heading-callout',
'label' => __( 'Design System Callout' ),
'isDefault' => false,
'style_handle' => 'design-system-styles',
);
register_block_style( $block_name, $style_properties );
}

add_action( 'init', 'register_heading_block_styles' );
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
],
"production": [
"composer validate",
"composer phpcbf",
"composer phpcs",
"npm run lint:css",
"npm run lint:js",
"npm run fix:js",
"npm run fix:css",
"npm run test",
"composer test"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/index-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'e12d17d5d3ec93812bbb');
<?php return array('dependencies' => array(), 'version' => 'db8b68fe0b446961ddb8');
2 changes: 1 addition & 1 deletion dist/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function design_system_enqueue_global_js_scripts() {
*/
function design_system_include_block_style_variations( $dir_path ) {
// Define the block style variation files.
$block_style_variation_files = [ 'navigation' ];
$block_style_variation_files = [ 'navigation', 'heading' ];

// Include specified block style variation files.
foreach ( glob( $dir_path . '/*.php' ) as $file ) {
Expand Down
16 changes: 16 additions & 0 deletions src/styles/block-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@
}
}

.is-style-wp-block-heading-callout {
position: relative;
margin-top: 3rem !important;
margin-bottom: 1.5rem !important;
}

.is-style-wp-block-heading-callout::before {
content: "";
position: absolute;
top: -10px;
left: 0;
width: 36px;
height: 4px;
background-color: #fcba19;
}

@media (max-width: $break-medium) {

.dswp-text-image-block-custom-layout *,
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: WordPress Design System theme is a theme that leverages the full-si
Requires at least: 6.4.4
Tested up to: 6.5
Requires PHP: 7.4
Version: 1.3.0
Version: 1.4.0
License: Apache License Version 2.0
License URI: LICENSE
Text Domain: design-system-wordpress-theme
Expand Down

0 comments on commit 84089ab

Please sign in to comment.