-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
chore(1-3450): Place strategy names and titles on the same line (and fix list nesting issues) #9443
chore(1-3450): Place strategy names and titles on the same line (and fix list nesting issues) #9443
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
90b000f
to
7bb204a
Compare
frontend/src/component/common/StrategyItemContainer/StrategyItemContainer.tsx
Outdated
Show resolved
Hide resolved
const StyledHeaderContainer = styled('hgroup')(({ theme }) => ({ | ||
display: 'flex', | ||
flexFlow: 'row', | ||
columnGap: '1ch', |
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.
Approximates one space.
frontend/src/component/common/StrategyItemContainer/StrategyItemContainer.tsx
Show resolved
Hide resolved
<li> | ||
{releasePlans.length > 0 ? ( | ||
<StrategySeparator /> | ||
) : null} |
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.
Nest nested lists within list items and add the separator between release plans and strategies to this element instead of the first strategy.
Emetion complains that: > The pseudo class :first-child is potentially unsafe when doing server-side rendering. Try changing it to :first-of-type. First of type won't work, so use classes instead.
'& > li': { | ||
paddingBlock: theme.spacing(2.5), | ||
position: 'relative', | ||
}, | ||
'&:not(li > &) > li:first-of-type': { | ||
// select first list elements in lists that are not directly nested | ||
// within other lists. | ||
paddingTop: theme.spacing(1), | ||
}, | ||
'& > li:has(> ol)': { | ||
// nested lists add their own padding to their list items, so we don't want to double it up. | ||
paddingBlock: 0, | ||
}, |
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.
Yay, CSS selectors 🥳 I moved all the li spacing and positioning up here so that it's colocated.
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.
LG!
Moves strategy titles and names onto the same line, as per the new designs.
In doing so, I've also updated the component to use a more semantic hgroup with the header being the strategy title if it exists or the strategy name if not.
The downside of being more semantically correct here is that we need to know what header level we want the strategy to use. In most cases, that's 3 (e.g. flag name > environment > strategy, release plan > milestone > strategy), but for plans on flag envs, it's 4 (flag name > env > milestone name > strategy).
I've also taken the opportunity to fix a little mistake I made earlier.
ol
s can only haveli
children, and I'd forgotten to wrap a nestedol
inside anli
. The changes inEnvironmentAccordionBody
all relate to that change. Because we now have several layers of lists nested within each other, dealing with styling and padding gets a little tricky, but CSS has the power do help us out here.Rendered:
