Skip to content

Conversation

@tylersticka
Copy link
Member

@tylersticka tylersticka commented Aug 17, 2021

Overview

This PR refactors our heading component class and template to accept a subheading option.

It differs slightly from the prototype in that the subheading has a medium font weight instead of normal because I thought that made the two segments of the heading appear more closely related.

The reasons for the refactor are as follows:

  • The previous structure made it challenging to correctly align a permalink if a subheading is present.
  • The previous template assumed that permalinks were the sole reason the complexity of the markup might change, but subheadings complicated this.
  • The previous stories, which each had their own separate demo file, made testing various combinations of options challenging, leading me to rewrite the stories using controls.
  • Because the content and subheading options may be properties or blocks, I found it necessary to add some additional makeTwig* utility functions for defining the templateSource intelligently.

I marked this as a minor change because the template syntax has not changed.

See the docs and code comments for specific implementation details.

Screenshots

Screenshot 2021-08-17 at 12-48-17 Storybook

Testing

On the deploy preview...

  1. Verify that Heading stories work as intended
  2. Check that the Heading story code samples change accurately depending on controls
  3. Verify that the Speaking Event prototype's "Watch" heading and subheading work as intended

/CC @dromo77 @calebeby

@changeset-bot
Copy link

changeset-bot bot commented Aug 17, 2021

🦋 Changeset detected

Latest commit: bb41eed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudfour/patterns Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tylersticka tylersticka marked this pull request as ready for review August 17, 2021 20:08
@tylersticka tylersticka requested review from a team August 17, 2021 20:08
Copy link
Member

@calebeby calebeby left a comment

Choose a reason for hiding this comment

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

@tylersticka The source code generation thing is so cool! I love how it switches between embed and include!

Co-authored-by: Caleb Eby <calebeby@users.noreply.github.com>
@tylersticka tylersticka merged commit 3070fde into v-next Aug 17, 2021
@tylersticka tylersticka deleted the feature/heading-with-sub branch August 17, 2021 22:33
@github-actions github-actions bot mentioned this pull request Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Heading with subtext

3 participants