-
Notifications
You must be signed in to change notification settings - Fork 10
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
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Interactive Blocks
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes