Skip to content

Commit c1108a2

Browse files
committed
Updated some standard margin issues and fixed a bug with the hero pattern
1 parent 4b3713d commit c1108a2

5 files changed

Lines changed: 75 additions & 59 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ over new ones, in this order:
1818
token already expresses.
1919
2. **Existing classes / block styles next.** `.lead`, `.display-1``4`, `.h1``6`,
2020
`.btn-*`, `.is-style-*` (card / jumbotron / well / alert-* / table-* / quote /
21-
pullquote / thick separator), text helpers, `.mt-0/.mb-0/.my-0`. Reuse these
21+
pullquote / thick separator), text helpers, `.mt-0/.mb-0/.my-0`, `.mx-auto`.
22+
Reuse these
2223
rather than writing pattern-local CSS.
2324
3. **Core block controls next.** Many things that look like they need CSS are now
2425
native controls: Group **`minHeight`**, flex/constrained layouts, per-block

assets/css/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

patterns/feature-row.php

Lines changed: 65 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -9,69 +9,78 @@
99
* @package ucf-wordpress-block-theme
1010
*/
1111

12-
$items = array(
13-
array(
14-
'logo' => esc_html__( '60+', 'ucf-wordpress-block-theme' ),
15-
'text' => esc_html__( 'For 60+ years, UCF has partnered with NASA to power space exploration and technology', 'ucf-wordpress-block-theme' ),
16-
'cite' => '',
17-
),
18-
array(
19-
'logo' => esc_html__( 'No. 1', 'ucf-wordpress-block-theme' ),
20-
'text' => esc_html__( 'Supplier of talent to the nation\'s aerospace and defense industries for six years in a row', 'ucf-wordpress-block-theme' ),
21-
'cite' => esc_html__( 'Aviation Week Network', 'ucf-wordpress-block-theme' ),
22-
),
23-
array(
24-
'logo' => esc_html__( 'Top 10', 'ucf-wordpress-block-theme' ),
25-
'text' => esc_html__( 'UCF is a top ten most innovative public university in the nation', 'ucf-wordpress-block-theme' ),
26-
'cite' => esc_html__( 'U.S. News & World Report', 'ucf-wordpress-block-theme' ),
27-
),
28-
);
12+
?>
13+
<!-- wp:group {"align":"full","backgroundColor":"secondary","textColor":"inverse","layout":{"type":"constrained"},"style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}}} -->
14+
<div class="wp-block-group alignfull has-secondary-background-color has-inverse-color has-text-color has-background" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)">
15+
<!-- wp:columns {"align":"wide"} -->
16+
<div class="wp-block-columns alignwide">
17+
<!-- wp:column -->
18+
<div class="wp-block-column">
19+
<!-- wp:group {"style":{"dimensions":{"minHeight":"6.5rem"}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"center"}} -->
20+
<div class="wp-block-group is-layout-flex wp-block-group-is-layout-flex" style="min-height:6.5rem">
21+
<!-- wp:heading {"textAlign":"center","className":"display-3"} -->
22+
<h2 class="wp-block-heading has-text-align-center display-3"><?php esc_html_e( '60+', 'ucf-wordpress-block-theme' ); ?></h2>
23+
<!-- /wp:heading -->
24+
</div>
25+
<!-- /wp:group -->
26+
27+
<!-- wp:separator {"className":"is-style-thick mx-auto"} -->
28+
<hr class="wp-block-separator has-alpha-channel-opacity is-style-thick mx-auto"/>
29+
<!-- /wp:separator -->
30+
31+
<!-- wp:paragraph {"align":"center"} -->
32+
<p class="has-text-align-center"><?php esc_html_e( 'For 60+ years, UCF has partnered with NASA to power space exploration and technology', 'ucf-wordpress-block-theme' ); ?></p>
33+
<!-- /wp:paragraph -->
34+
</div>
35+
<!-- /wp:column -->
36+
37+
<!-- wp:column -->
38+
<div class="wp-block-column">
39+
<!-- wp:group {"style":{"dimensions":{"minHeight":"6.5rem"}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"center"}} -->
40+
<div class="wp-block-group is-layout-flex wp-block-group-is-layout-flex" style="min-height:6.5rem">
41+
<!-- wp:heading {"textAlign":"center","className":"display-3"} -->
42+
<h2 class="wp-block-heading has-text-align-center display-3"><?php esc_html_e( 'No. 1', 'ucf-wordpress-block-theme' ); ?></h2>
43+
<!-- /wp:heading -->
44+
</div>
45+
<!-- /wp:group -->
2946

30-
$columns = '';
31-
foreach ( $items as $item ) {
32-
$logo = $item['logo'];
33-
$text = $item['text'];
47+
<!-- wp:separator {"className":"is-style-thick mx-auto"} -->
48+
<hr class="wp-block-separator has-alpha-channel-opacity is-style-thick mx-auto"/>
49+
<!-- /wp:separator -->
3450

35-
$cite = '';
36-
if ( '' !== $item['cite'] ) {
37-
$cite_text = $item['cite'];
38-
$cite = <<<HTML
39-
<!-- wp:paragraph {"align":"center","fontSize":"sm"} -->
40-
<p class="has-text-align-center has-sm-font-size"><em>$cite_text</em></p>
41-
<!-- /wp:paragraph -->
42-
HTML;
43-
}
51+
<!-- wp:paragraph {"align":"center"} -->
52+
<p class="has-text-align-center"><?php esc_html_e( 'Supplier of talent to the nation\'s aerospace and defense industries for six years in a row', 'ucf-wordpress-block-theme' ); ?></p>
53+
<!-- /wp:paragraph -->
4454

45-
$columns .= <<<HTML
46-
<!-- wp:column -->
47-
<div class="wp-block-column">
48-
<!-- wp:group {"style":{"dimensions":{"minHeight":"6.5rem"}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"center"}} -->
49-
<div class="wp-block-group is-layout-flex wp-block-group-is-layout-flex" style="min-height:6.5rem">
50-
<!-- wp:heading {"textAlign":"center","className":"display-3"} -->
51-
<h2 class="wp-block-heading has-text-align-center display-3">$logo</h2>
52-
<!-- /wp:heading -->
55+
<!-- wp:paragraph {"align":"center","fontSize":"sm"} -->
56+
<p class="has-text-align-center has-sm-font-size"><em><?php esc_html_e( 'Aviation Week Network', 'ucf-wordpress-block-theme' ); ?></em></p>
57+
<!-- /wp:paragraph -->
5358
</div>
54-
<!-- /wp:group -->
59+
<!-- /wp:column -->
5560

56-
<!-- wp:separator {"className":"is-style-thick"} -->
57-
<hr class="wp-block-separator has-alpha-channel-opacity is-style-thick"/>
58-
<!-- /wp:separator -->
61+
<!-- wp:column -->
62+
<div class="wp-block-column">
63+
<!-- wp:group {"style":{"dimensions":{"minHeight":"6.5rem"}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"center"}} -->
64+
<div class="wp-block-group is-layout-flex wp-block-group-is-layout-flex" style="min-height:6.5rem">
65+
<!-- wp:heading {"textAlign":"center","className":"display-3"} -->
66+
<h2 class="wp-block-heading has-text-align-center display-3"><?php esc_html_e( 'Top 10', 'ucf-wordpress-block-theme' ); ?></h2>
67+
<!-- /wp:heading -->
68+
</div>
69+
<!-- /wp:group -->
5970

60-
<!-- wp:paragraph {"align":"center"} -->
61-
<p class="has-text-align-center">$text</p>
62-
<!-- /wp:paragraph -->
63-
$cite
64-
</div>
65-
<!-- /wp:column -->
66-
HTML;
67-
}
71+
<!-- wp:separator {"className":"is-style-thick mx-auto"} -->
72+
<hr class="wp-block-separator has-alpha-channel-opacity is-style-thick mx-auto"/>
73+
<!-- /wp:separator -->
6874

69-
?>
70-
<!-- wp:group {"align":"full","backgroundColor":"secondary","textColor":"inverse","layout":{"type":"constrained"},"style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}}} -->
71-
<div class="wp-block-group alignfull has-secondary-background-color has-inverse-color has-text-color has-background" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)">
72-
<!-- wp:columns {"align":"wide"} -->
73-
<div class="wp-block-columns alignwide">
74-
<?php echo $columns; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- composed from escaped strings above. ?>
75+
<!-- wp:paragraph {"align":"center"} -->
76+
<p class="has-text-align-center"><?php esc_html_e( 'UCF is a top ten most innovative public university in the nation', 'ucf-wordpress-block-theme' ); ?></p>
77+
<!-- /wp:paragraph -->
78+
79+
<!-- wp:paragraph {"align":"center","fontSize":"sm"} -->
80+
<p class="has-text-align-center has-sm-font-size"><em><?php esc_html_e( 'U.S. News & World Report', 'ucf-wordpress-block-theme' ); ?></em></p>
81+
<!-- /wp:paragraph -->
82+
</div>
83+
<!-- /wp:column -->
7584
</div>
7685
<!-- /wp:columns -->
7786
</div>

patterns/hero.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
?>
1515
<!-- wp:cover {"customGradient":"linear-gradient(180deg,rgba(0,0,0,0.25) 0%,rgba(0,0,0,0.55) 100%)","minHeight":500,"minHeightUnit":"px","align":"full","className":"ucf-hero","layout":{"type":"constrained"}} -->
16-
<div class="wp-block-cover alignfull ucf-hero" style="min-height:500px"><span aria-hidden="true" class="wp-block-cover__background has-background-gradient" style="background:linear-gradient(180deg,rgba(0,0,0,0.25) 0%,rgba(0,0,0,0.55) 100%)"></span><div class="wp-block-cover__inner-container">
16+
<div class="wp-block-cover alignfull ucf-hero" style="min-height:500px"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-100 has-background-dim has-background-gradient" style="background:linear-gradient(180deg,rgba(0,0,0,0.25) 0%,rgba(0,0,0,0.55) 100%)"></span><div class="wp-block-cover__inner-container">
1717
<!-- wp:heading {"level":1,"textColor":"inverse","className":"display-2"} -->
1818
<h1 class="wp-block-heading has-inverse-color has-text-color display-2"><?php esc_html_e( 'Page Title', 'ucf-wordpress-block-theme' ); ?></h1>
1919
<!-- /wp:heading -->

src/scss/_spacing.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ blockquote,
4040
margin-block-start: 0;
4141
margin-block-end: 0;
4242
}
43+
44+
// Center a block horizontally by pushing equal auto margins (e.g. a fixed-width
45+
// separator or image). Mirrors Bootstrap's `.mx-auto`.
46+
.mx-auto {
47+
margin-inline: auto;
48+
}

0 commit comments

Comments
 (0)