-
Notifications
You must be signed in to change notification settings - Fork 8
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: Visualise grid lines through a background gradient #1390
Conversation
storybook/config/preview-body.html
Outdated
inset-block: 0; | ||
inset-inline: var(--margin-width); | ||
position: absolute; |
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 resorted to this to ensure the background image doesn’t overlap the horizontal grid padding – background-position
doesn’t work. But it hampers inspecting the element through dev tools, so a better solution is welcome. We could then probably apply the background to the element itself instead of a pseudo-element.
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.
(This is now in docs.css
.)
@@ -66,7 +69,7 @@ type CellStory = StoryObj<typeof cellMeta> | |||
const StoryTemplate: Story = { | |||
decorators: [ | |||
(Story) => ( | |||
<Screen> | |||
<Screen className="ams-storybook-show-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.
I’d prefer to apply the class to the grid itself, but setting it on <Story />
doesn’t get it applied.
Making it an arg
in meta
sets it on Grid Cells as well, resulting in an incorrect background pattern.
…s anything helpful
# Conflicts: # storybook/config/preview-body.html # storybook/src/components/Grid/Grid.docs.mdx
Superseded by #1605. |
This shows light grey grid lines on the Grid docs page to indicate the columns. It separates the concepts of columns and cells – cells are still pink. Examples are full screen which adds to the experience as well.
It uses a gradient background based on the grid variables. The lines are a bit off in Safari, unfortunately, but in Chrome and Firefox they appear correctly. One comment for it on the code though.
I got the idea while working on the Spotlight with break-out content, for which a separate PR will follow.
About the class name and file used: I intend to merge all documentation classes under one namespace, either.ams-docs-*
or.ams-storybook-*
and move them into one file shortly.