Skip to content

Commit

Permalink
Remove the stylesheet to make ui quicker.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne committed Dec 7, 2023
1 parent 167fd8e commit b8fccfd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { registerBlockType } from '@wordpress/blocks';
*/
import Edit from './edit';
import metadata from './block.json';
import './style.scss';

registerBlockType( metadata.name, {
edit: Edit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function render( $attributes, $content, $block ) {
}

foreach ( $grouped_events as $month_year => $events ) {
$content .= "<h2 class='wporg-marker-list__container__title'>$month_year</h2>";
$content .= get_section_title( $month_year );
$content .= '<ul class="wporg-marker-list__container">';

foreach ( $events as $event ) {
Expand Down Expand Up @@ -124,3 +124,21 @@ function filter_events( array $events ): array {

return $filtered_events;
}

/**
* Returns core heading block markup for the date groups.
*
* @param string $heading_text Heading text.
*
* @return string
*/
function get_section_title( $heading_text ) {
$block_markup = '<!-- wp:heading {"style":{"elements":{"link":{"color":{"text":"var:preset|color|charcoal-1"}}},"typography":{"fontStyle":"normal","fontWeight":"700"},"spacing":{"margin":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|20"}}},"textColor":"charcoal-1","fontSize":"medium","fontFamily":"inter"} -->';
$block_markup .= sprintf (
'<h2 class="wp-block-heading has-charcoal-1-color has-text-color has-link-color has-inter-font-family has-medium-font-size" style="margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--20);font-style:normal;font-weight:700">%s</h2>',
esc_html( $heading_text )
);
$block_markup .= '<!-- /wp:heading -->';

return $block_markup;
}

This file was deleted.

0 comments on commit b8fccfd

Please sign in to comment.