Open james-nash opened 5 years ago
Patterns with multiple states (e.g. plain button, disabled button and submit button are all the saem HTML element) or variants are listed as individual entries causing the false impression that they are separate components
This point will be easy to address once we migrate to Fractal (see issue #264 / PR #262), since we can give such components a custom preview template that shows all possible states. Alternatively we can do them as "variants" with a collated preview.
I've given it a bit of thought, and here's my proposal for an updated structure:
├── Particles (design tokens & assets) - same as now
│ ├── Color
│ ├── Typography
│ └── ...
├── Elements (just the plain HTML elements)
│ ├── Inline-text
│ ├── Block-text
│ └── ...
├── Helpers (object & utility classes from our ITCSS structure)
│ ├── Layouts
│ │ ├── Multi-column
│ │ ├── Page
│ │ └── ...
│ ├── Utilities
│ └── ...
├── Components (components from our ITCSS structure)
│ ├── Atoms
│ ├── Molecules
│ └── Organisms
└── Examples
├── Templates
└── Pages
Introducing a new top-level and the dividing existing stuff into it aims to address a number of issues we currently have:
<ul>
or <table>
is really an atom or not. They now stand apart from the Atomic Design categories. This also makes the pattern library's navigation align with our SASS source code folders - this now maps directly to the elements
layer in ITCSS.grav-c-*
class. I think we can continue using Atomic Design (up to organisms) as the 2nd level within this. I suspect classifying this will become easier too.section
one (see issue #276).Overall, I think something like this structure would be big improvement over what we currently have. It'll be quite easy to implement in Fractal too, since that lets us have as many levels of navigation as we want.
There'll be a few items that might feel a tad odd. For instance buttons will come under elements and not components - people familair with other design systems might find that a bit unintuitive. But, I think people actually using or working on Gravity will quickly get used to that. Besides, it's certainly no worse than it is today. :-)
Given the lack of objections and counter-proposals, I'll make a start at implementing my proposed re-org in a PR. It'll probably take a while, so please be patient. Will report progress back here once there's something to see...
Is your feature request related to a problem? Please describe. Currently, the way patterns are organised in our online pattern library is a bot messy:
This causes a number of issues:
Describe the solution you'd like We should:
Additional context This came out of a chat with @dw-buildit today, while trying to decide where best to put a
.grav-o-two-column
class. Layout primitives like that don't fit well under atoms since they layout a set of other things, so they are inevitably applied to some kind of container. And yet, it's mot clear if they should be considered molecules or organisms, since we don't (and can't) know how complex the things being laid out will be.I'd argue utility classes have similar challenges. Really, objects and utilities are not components at all, so perhaps they should exist outsode of the Atomic Design categories.
Dan also, rightly IMHO, pointed out that our "atoms" section is confusing. It is a combination of plain HTML elements (some of which have or imply some kind of composition - e.g.
<table>
or<ul>
- and thus don't really feel like indivisible atoms) and Gravity-specific components like "nav link" or "pull quote". What we both felt might be a good solution is to divide them. "Atoms" could be reserved for the Gravity specific things only and plain HTML elements go somewhere else.Reviewing older issues, I see that @ThePeach suggested more or less the same a year ago in #106.