bloom-works / guides-template

Placeholder repo for work on Bloom Guides
https://bloom-guides-template.netlify.app/
MIT License
2 stars 0 forks source link

Component: Checklist #14

Closed jeffmaher closed 1 year ago

jeffmaher commented 1 year ago

Stories

Notes

Done When

jrubenoff commented 1 year ago

Assumptions

As per our GDoc discussion, I'm assuming this is not an interactive checklist. So, we don't need to let readers check or uncheck each item.

Design

Here's what I have right now:

CleanShot 2023-06-14 at 10 19 12@2x

After converting the guide to Markdown, I noticed the Key Questions sections looked weird and unstyled next to the checklist component. So I created a new Key Questions component... it's the same, except with a different icon and background color.

CleanShot 2023-06-14 at 10 19 19@2x

@SMakaiTakori I've kept these two components separate, even though they're so similar. That's because I think authors benefit from really clear guidance on when to use specific components. But if you want to use this pattern for other types of content later on, we could combine the two into a single "Fancy List" component (or something similar.)

Component API

How might we create a single source of truth for this component while keeping it easy for non-engineers to edit? Here are 2 options I can think of.

(Both examples use Nunjucks. I'm assuming we'll have a "playground" of example components that authors can copy and paste from, so they won't need to remember specific markup patterns.)

Option 1

Use separate partials for the beginning and end of the list, like so:

{{ checklist-start }}
- Item One
- Item Two
- Item Three
{{ checklist-end }}

This seems really simple for authors. But a single component spread across multiple partials is more annoying to maintain.

Option 2

{% set checklistContent %}
- Item One
- Item Two
- Item Three
{% endset %}

{{ checklist items=checklistContent }}

This seems neater from a dev perspective. But if there are multiple checklists on a page, the authors will need to remember to replace checklistContent with a unique variable name. That seems annoying

@jeffmaher @SMakaiTakori Let me know what sounds best here.

Status

I've committed an example to the storybook branch. I've also created a Nunjucks template locally in an 11ty instance (although we still need to decide upon the component API above.)

I can open a PR with just these components once #5 and #6 are done.

SMakaiTakori commented 1 year ago

I've kept these two components separate, even though they're so similar. That's because I think authors benefit from really >clear guidance on when to use specific components. But if you want to use this pattern for other types of content later on, we >could combine the two into a single "Fancy List" component (or something similar.)

@jrubenoff It does sound beneficial to keep both components, I like this idea! The checklists look nice and clean.

Regarding the Component API, I am leaning more towards making this as user friendly as possible for authors with option 1. If we go with option 2, we would have to have the guidance written somewhere for replacing the variable and that seems like it could be a lot for a non dev.

What do you think @jeffmaher ?

jeffmaher commented 1 year ago

+1 to what @SMakaiTakori said.

jeffmaher commented 1 year ago

Review from @admoorgit needed on this one, and then a review @LynnHerrick9

admoorgit commented 1 year ago

@jeffmaher these look good to me. Off to @LynnHerrick9 for review!

LynnHerrick9 commented 1 year ago

@jeffmaher I have finished review and approved

SMakaiTakori commented 1 year ago

@SMakaiTakori to handle merge conflicts