-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library layout components, simplified #144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$-library-vertical-spacing: 7; | ||
.LibraryPage { | ||
// Make sure the content width is not too terribly wide: it gets hard to read | ||
max-width: 75rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
I think that's helpful feedback. This particular page of patterns is a little hard to assess regarding "frames" because several of the components are frames themselves. Which leads to a sense of overwhelming frame-i-ness. If I might ask permission to take a look at this during the conversion of the next set of pages to this model? That way I can see how "demo" layout feels in real-world demo use cases and try to see if I can find a simpler style. |
4698e1e
to
f0ef4b4
Compare
This PR proposes a new collection of rather simple components for rendering Pattern Library pages:
Page
,Pattern
,Example
andDemo
. These components represent an improvement on existing pattern-library components:This PR contains a component module with these components (
Library
), styles, and an example of one of the pattern-library pages converted to use the new components.This represents a coalescing of “lessons learned” from the first crop of pattern-library components. This was a quick implementation based on the growing set of underlying tools and patterns!
Before
"Container components" page before these changes:
Layout breaks on narrow screens:
After
The layout is now responsive:
Proposed Model
In this model, a
Page
contains zero or morePattern
sections. APattern
contains zero or moreExample
s. And anExample
contains zero or moreDemo
s.Demo
takes awithSource
boolean
prop. Whentrue
, it will render into a tabbed format. Here's what it looks like with the "Source" tab activated:When
false
, it will not provide source (second "Demo" here does not have source):All of these components are in a single module
Library
. Because the expectation is to import the set of components at once (e.g.import * as Library from ‘../Library’;
) I’ve elected to leave the module name upper-case. Our convention for component modules that export multiple components has been to this point lower-case, however, this usage model is different. Discussion welcomed!Previous Model and shortcomings
(For reference if interested).
The previous model is
PatternPage
,Pattern
,PatternExamples
,PatternExample
.PatternExamples
uses a tabular layout, which is most often fine, but can cumbersome to manage in layout. And it’s not responsive.base
selector styles. This can cause leakage into rendered patterns, and other complexity. The styling is also rather verbose and ad-hoc as it has developed over time.PatternExample
will always render its source, which is sometimes not what you’d want. The “middle column” of an example row is kind of useless at present. Authors are forced to put example explanations into atitle
prop, which is awkward.PatternExamples
doesn’t have much “meaning” as a component, and is used primarily to render a wrapping table.Where to?
Assuming this kind of approach is reasonable, next steps would be to:
client
, will have to verify that LMS does not have any) to use Library componentsPatternPage
componentsFixes #102