-
Notifications
You must be signed in to change notification settings - Fork 6
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
DSD-1884: new template component #1711
DSD-1884: new template component #1711
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
You can remove "new" from the component and file names since this is a breaking change update.
<TemplateFooter>{footer}</TemplateFooter> | ||
</Template> | ||
); | ||
const { container } = render(<>{templateChildren}</>); |
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 it'd be good to make templateChildren
a function and pass in the value of the sidebar, either left or right. Then you can have two accessibility tests and verify both sidebar variants (and the default without a sidebar) are all accessible.
<TemplateContentPrimary>{contentPrimary}</TemplateContentPrimary> | ||
</TemplateContent> | ||
<TemplateFooter>{footer}</TemplateFooter> | ||
<Template sidebar={sidebar}> |
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.
Similar comment here, this is a snapshot for the left sidebar but have snapshots for other variants.
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.
src/theme/components/template.ts
Outdated
m: "0 auto", | ||
p: "s", | ||
gridTemplateAreas: `"breakout" "top" "main" "bottom"`, | ||
gridTemplateColumns: "repeat(1, minmax(100px, 1fr))", |
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.
How did you get 100px for the first value in minmax?
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.
Arbitrarily, though I think it looks good.... it should probably be decided on by @bigfishdesign13.
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.
The smallest screen width that designers consider (in theory) is 320px, so I'd suggest changing the min here to 320px.
Why use repeat
when it's not repeating?
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.
Actually, I'd argue that minmax
should be removed altogether from the column styles and instead apply minWidth: "320px"
to the full grid.
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.
If the smallest screen width is 320, then the minWidth of the grid should be smaller than that, no?
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.
@oliviawongnyc Yes. That is what I was referring to during our call earlier. It should be 320 minus the value of the padding. For the mobile viewport the padding on either side is 16px, so the minWidth
for the grid should be set to "288px"
.
320px - (16px x 2) = 288px
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.
Minor comments. I will approve once others get a chance to review the PR (I think I've been looking so often that at this point I will miss things).
Important: make a feature branch and point this PR into that branch. This should not accidentally be merged into development
and this feature won't go out until 4.0 is released.
<Template sidebar={sidebar}> | ||
<TemplateBreakout>{breakout}</TemplateBreakout> | ||
<TemplateTop>{contentTop}</TemplateTop> | ||
{sidebar !== "none" && !useMainNarrow && ( |
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.
Not too big of a deal since this is a test, but if "sidebar" is "right", the DOM will not be in the right order.
@jackiequach @7emansell @bigfishdesign13 if you get a chance to review, please try to before 12/11. |
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.
The "Template Full Example" is very cramped at 600px screen width. Otherwise, this looks great!
src/theme/components/template.ts
Outdated
*/ | ||
|
||
export const responsiveGap = { base: "1rem", md: "1.5rem", xl: "1rem" }; | ||
export const responsivePadding = { base: "1rem", md: "1.5rem", xl: "2rem" }; |
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.
To keep proper alignment in the UI, this same type of responsive padding will be used in a number of other components. The responsive gaps could also be used in some places. Do you think it would make sense to move these into global.ts
?
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.
Yes, could this also be a general "DS gap" and "DS padding" set of values that can be used elsewhere? Perhaps exported as design tokens if consuming apps need them.
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 was thinking about this a bit more. Design tokens are static, while this object is responsive. From what I recall, the only other design tokens that are setup with reference to screen size are the form input height values. There's one for default (anything other than mobile) and one for mobile. If we do setup tokens for these gap values, I would like to do it using the naming conventions of the new breakpoints (small mobile, large mobile, etc.).
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.
Some suggestions.
src/theme/components/template.ts
Outdated
baseStyle: defineStyle({ | ||
gridColumn: { base: "1", md: "1 / span 2" }, | ||
paddingX: "s", | ||
maxWidth: { lg: "720px" }, |
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.
Let's see if we can bring this into alignment with the 12-column grid. When using a 12-column grid at 1280px with appropriate padding and gaps, an eight column span is 822px. And interestingly, DC is using 820px max width on the About page.
The underlying grid for desktop would use:
gridTemplateColumns: "1fr 4fr 1fr"
And the content area would be the 4fr
column.
For tablet, maybe something like this:
gridTemplateColumns: "1fr 10fr 1fr"
And the next jump would just be "1fr"
(full width).
Thoughts?
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 won't be able to work on this myself, but I think we can achieve this in TemplateMainNarrow
by adding display: grid
and something like gridTemplateColumns: "2fr minmax(800, 8fr) 2fr"
. This second value would need to be fiddled with.
Then, the component needs to have another div
wrapper like so:
const TemplateMainNarrow: React.FC<React.PropsWithChildren<TemplateMainProps>> =
({ children, id = "mainContent" }) => {
const styles = useStyleConfig("TemplateMainNarrow");
return (
<Box as="main" id={id} gridArea="main" __css={styles}>
<div style={{ gridColumn: 2 }}>{children}</div>
</Box>
);
};
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.
`} | ||
language="jsx" | ||
/> | ||
TBD. |
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 will work on this.
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.
TY!
I'm going to merge this PR in and we can work on subsequent fixes in future PRs as planned. |
Fixes JIRA ticket DSD-1884 and DSD-1885
This PR does the following:
Template
wrapper component and children componentsHow has this been tested?
Accessibility concerns or updates
Accessibility Checklist
aria-live
is used, a screenreader was used to verify the text is read.ref
s, focus management was reviewed.Open Questions
Checklist:
Front End Review: