livingcss icon indicating copy to clipboard operation
livingcss copied to clipboard

Feature/namespace tag

Open digitalfu opened this issue 6 years ago • 7 comments

Here's what I came up with, I hope the data attribute is acceptable.

digitalfu avatar Jun 04 '18 15:06 digitalfu

Coverage Status

Coverage increased (+0.01%) to 94.986% when pulling 78186a635e8d228f5a65022dc9cb54d4d8f85e71 on digitalfu:feature/namespace-tag into 9b0fd2785504bb60656d07e216e03a97b7e31815 on straker:master.

coveralls avatar Jun 04 '18 16:06 coveralls

Awesome. I'll take a look at it more closely later tonight.

straker avatar Jun 04 '18 16:06 straker

Quick question: would the same namespace be something you'd want applied to every example or just a few?

straker avatar Jun 07 '18 04:06 straker

My use case right now will require it on every doc item so it could be declared at the project level (as global configuration) but I think it's better if they are defined individually at the doc item level, here's why:

  • Multiple or partial namespaces will be accommodating to less than perfect/legacy systems, a project can progressively migrate from one to another, from none to n, or from n to none.
  • The namespace will be declared as part of the in code documentation, and not just some magical configuration value (inline with the 'living style guide' ideals AFAIK).

Further to that I though it might be nice to show the namespace (when preset) in the UI as a small tag/label on each example.

What are you thinking?

digitalfu avatar Jun 07 '18 04:06 digitalfu

I was just thinking that it might be tedious to remember to add the namespace to every example, otherwise your output is visually broken, but that's just me. The visual label would probably be a good indication of what's missing though, so that might do well as the reminder.

straker avatar Jun 07 '18 04:06 straker

We could have both options, global configuration optionally overridden at the example level?

As for the label, I was thinking it would only show up if there was a namespace defined, primarily because I think the large majority of projects wont use them, it would be a distraction most of the time, but I could use the string "Global" when there is none so the namespace is always explicit (in the UI) (only becomes confusing if the creator actually uses a namespace called "Global"). The reminder would then be more for the users of the style guide, reminding them to include the namespace in any implementations that utilize the design system as apposed to the a reminder for the creators of the style guide itself.

Does that change your mind about anything and how would you like me to proceed?

digitalfu avatar Jun 07 '18 05:06 digitalfu

👍 I like it.

A global level would make maintaining the docs a bit easier, and having the ability to override it per example will make it more flexible. I like the visual label for the consumers.

straker avatar Jun 07 '18 05:06 straker