Skip to content

feat: add id support to patterns#5703

Merged
jmuzina merged 8 commits intocanonical:mainfrom
britneywwc:add-id-patterns
Dec 4, 2025
Merged

feat: add id support to patterns#5703
jmuzina merged 8 commits intocanonical:mainfrom
britneywwc:add-id-patterns

Conversation

@britneywwc
Copy link
Contributor

@britneywwc britneywwc commented Nov 28, 2025

Rationale

  • This update adds IDs to section headers to enable anchor linking. This was requested for the new copy-doc template by @Sophie-32.
  • The goal is to extend ID support to all patterns required by the template, allowing stakeholders to navigate directly to specific sections from within the copy doc.

Done

  • Add id support to three patterns:
    • Basic section
    • Pricing block
    • Equal heights
  • Amend docs and examples with the ID

Fixes WD-31488

QA

  • Open demo
  • Go to Basic Section
    • Check that the h2 heading title under "Basic section / Mixed content" has an ID attached to it
    • Scroll down to Jinja Macro section
    • Check that title.id documentation has been updated
  • Go to Pricing Block
    • Repeat previous steps for the examples: 4 blocks, 3 blocks, 2 blocks and 1 block
    • Check that "Title ID" documentation has been added in the description table (at the top of the page) and also under "Jinja macros"
  • Go to Equal Heights
    • Repeat previous steps for the examples: 4 blocks, 3 blocks, 2 blocks and 1 block
    • Check that "Title ID" documentation has been added in the description table (at the top of the page) and also under "Jinja macros"

Check if PR is ready for release

If this PR contains Vanilla SCSS or macro code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 🎁, Breaking Change 💣, Bug 🐛, Documentation 📝, Maintenance 🔨.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention
    • if existing APIs (CSS classes & macro APIs) are not changed it can be a bugfix release (x.x.X)
    • if existing APIs (CSS classes & macro APIs) are changed/added/removed it should be a minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) or macros should be listed on the what's new page.

Screenshots

[if relevant, include a screenshot or screen capture]

@webteam-app
Copy link

@britneywwc
Copy link
Contributor Author

Thanks for the reviews @Onibenjo @jmuzina!

I updated it with both your suggestions:

  • Adding ID to section/div level
  • Allow ID to be passed in as attrs object

Could you please have another look?

Copy link
Contributor

@Onibenjo Onibenjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments.

Also the QA steps needs updating from the old title id wording.

Aside these, LGTM.

Copy link
Contributor

@Onibenjo Onibenjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion for consistency.

LGTM.

@Onibenjo
Copy link
Contributor

Onibenjo commented Dec 3, 2025

@britneywwc can you fix the conflict. There's been a version bump on the main branch

Copy link
Member

@jmuzina jmuzina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small changes to get this ready for merge / release - I'll merge afterwards if all the checks are passing :)

@britneywwc
Copy link
Contributor Author

Thanks again for the reviews! I'll leave the PR open until @jmuzina approves the pending checks :)

@jmuzina jmuzina merged commit 4aaf451 into canonical:main Dec 4, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants