You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
I'm working on a project where there is a hierarchical <ul> pattern. The elements therein are pretty much identical, but their styles differ depending on their depth, and they also expand and collapse in certain cases.
Because I need to demonstrate their hierarchy, I can't just use the (awesome) listItems helper verbatim. I end up doing something kinda like this...
...except replace <!-- item --> with a more complex, recurring chunk of markup... definitely not DRY.
Because each item uses the same markup, my first instinct was to include it as a separate molecule pattern, but this is a bit of a unique scenario because this pattern just isn't that valuable to visualize outside of the list context.
So I prefixed its filename with an underscore and attempted to include it with the shorthand partials syntax ({{> molecules-_sidebar-item}}) but was surprised to see it didn't work.
Obviously I can use the traditional Mustache syntax and include the entire filepath, but to me it was not obvious that hiding a pattern would also prevent you from using the shorthand partial syntax.
The text was updated successfully, but these errors were encountered:
Ugh. Hadn't considered that use-case and it's a good one. You're in luck though as I'm in the guts of that part of PL currently. I'll change it up so that an underscore hides in navigation and style guide views but is available via partial syntax. And I'll make it available at {{> molecules-sidebar-item }}. That way one could hide and unhide an item without having to change partial calls.
hey, i forgot to follow-up to your docs email. still have to swing around to it. thanks though :) and also hope you find dev branch ok. still need to write up docs for that too ;)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm working on a project where there is a hierarchical
<ul>
pattern. The elements therein are pretty much identical, but their styles differ depending on their depth, and they also expand and collapse in certain cases.Because I need to demonstrate their hierarchy, I can't just use the (awesome)
listItems
helper verbatim. I end up doing something kinda like this......except replace
<!-- item -->
with a more complex, recurring chunk of markup... definitely not DRY.Because each item uses the same markup, my first instinct was to include it as a separate molecule pattern, but this is a bit of a unique scenario because this pattern just isn't that valuable to visualize outside of the list context.
So I prefixed its filename with an underscore and attempted to include it with the shorthand partials syntax (
{{> molecules-_sidebar-item}}
) but was surprised to see it didn't work.Obviously I can use the traditional Mustache syntax and include the entire filepath, but to me it was not obvious that hiding a pattern would also prevent you from using the shorthand partial syntax.
The text was updated successfully, but these errors were encountered: