-
Notifications
You must be signed in to change notification settings - Fork 5
Extensions Text Alignment Inheritance
Compatible With: Core text blocks (Paragraph, Heading, List, Quote, etc.) Since: 1.0.0
The Text Alignment Inheritance Extension automatically sets the initial text alignment of newly inserted text blocks based on their parent container's alignment. This creates a consistent, streamlined editing experience when working with aligned containers.
Key Features:
- One-time inheritance on block insertion
- Works with core text blocks (paragraphs, headings, lists, quotes)
- Reads parent container's text alignment setting
- Non-intrusive (user can freely change after insertion)
- No database attributes (uses context API)
- Create a Section, Row, or Group block
- Set container's Text Alignment to Center (or Left/Right)
- Insert a Paragraph or Heading block inside
- New block automatically inherits center alignment
- Change alignment freely afterward (inheritance is one-time only)
Container blocks (Section, Row, Grid, Group) provide textAlign context to children.
When text blocks are inserted:
- Check if parent has
textAlignset - If yes, and child has no alignment yet → inherit parent's alignment
- Mark as initialized (won't inherit again)
- User can change alignment afterward without interference
core/paragraphcore/headingcore/listcore/quotecore/pullquotecore/versecore/preformattedcore/code
Set Section to center-aligned, all new headings/paragraphs auto-center.
Container aligned right, quotes and attributions inherit right alignment.
Grid of cards all center-aligned, text blocks auto-center on insertion.
Left-aligned sidebar, all text blocks start left-aligned.
DO:
- Set container alignment before adding text blocks
- Use for consistent, aligned sections
- Change child alignment freely after insertion
- Combine with container alignment presets
DON'T:
- Expect re-inheritance after initial insertion
- Use on non-text blocks (images, buttons, etc.)
- Rely on inheritance for complex layouts (set manually)
- One-Time Only: Inheritance happens once on insertion, not continuously
- Override Anytime: Change child alignment without affecting parent
- Context API: Uses WordPress context (no custom attributes, no validation issues)
- Performance: WeakMap tracking (no database bloat)
-
Debugging: If not inheriting, check parent has
textAlignset and child is a text block
- Uses
providesContext(parent) andusesContext(child) - WeakMap tracks initialized blocks (no persistence to database)
- Runs once on component mount (empty dependency array)
- Only applies to supported text blocks
- No filter priority conflicts (lightweight implementation)
Auto-generated from
docs/extensions/TEXT-ALIGNMENT-INHERITANCE.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Blobs
- Breadcrumbs
- Card
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Flip Card
- Form Builder
- Grid
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Next Phase
- Modal Performance Fixes
- Modal Security Audit
- Modal Security Fixes Summary
- Modal Trigger
- Pill
- Progress Bar
- Reveal
- Row
- Scroll Accordion
- Scroll Gallery
- Section
- Slider
- Table Of Contents
- Tabs
- Timeline
- Animation
- Background Video
- Block Animations
- Clickable Group
- Custom Css
- Expanding Background
- Grid Mobile Order
- Grid Span
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Text Alignment Inheritance
- Text Reveal
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Control Reorganization
- Design System
- Wordpress Block Editor Best Practices
- Color Controls Pattern
- Custom Css Filters
- Performance Css Strategy
- Width Css Strategy Implementation
- Width Layout Patterns
- Antigravity Audit
- Card Block Audit
- Claude Audit
- Comprehensive Audit
- Cursor Audit
- Scroll Accordion Stacking Notes
- Security Review 1.2.1
- 2026 02 11 Icon Search Aliases Design
- 2026 02 14 Overlay Header Design
- 2026 02 15 Deactivation Block Migrator Design