Skip to content
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

Closed
wants to merge 9 commits into from

Conversation

VincentSmedinga
Copy link
Contributor

@VincentSmedinga VincentSmedinga commented Jul 15, 2024

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.

Comment on lines 96 to 98
inset-block: 0;
inset-inline: var(--margin-width);
position: absolute;
Copy link
Contributor Author

@VincentSmedinga VincentSmedinga Jul 15, 2024

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.

Copy link
Contributor Author

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.)

@github-actions github-actions bot temporarily deployed to demo-DES-802-visualise-grid-in-docs July 15, 2024 09:55 Destroyed
@@ -66,7 +69,7 @@ type CellStory = StoryObj<typeof cellMeta>
const StoryTemplate: Story = {
decorators: [
(Story) => (
<Screen>
<Screen className="ams-storybook-show-grid">
Copy link
Contributor Author

@VincentSmedinga VincentSmedinga Jul 15, 2024

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.

@github-actions github-actions bot temporarily deployed to demo-DES-802-visualise-grid-in-docs July 18, 2024 13:40 Destroyed
dlnr
dlnr previously approved these changes Jul 18, 2024
@VincentSmedinga VincentSmedinga marked this pull request as draft July 23, 2024 22:40
# Conflicts:
#	storybook/config/preview-body.html
#	storybook/src/components/Grid/Grid.docs.mdx
@github-actions github-actions bot temporarily deployed to demo-DES-802-visualise-grid-in-docs September 4, 2024 13:35 Destroyed
@VincentSmedinga VincentSmedinga marked this pull request as ready for review September 4, 2024 13:36
@github-actions github-actions bot temporarily deployed to demo-DES-802-visualise-grid-in-docs September 4, 2024 13:44 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-802-visualise-grid-in-docs September 4, 2024 13:46 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-802-visualise-grid-in-docs September 9, 2024 08:07 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-802-visualise-grid-in-docs September 11, 2024 10:18 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-802-visualise-grid-in-docs September 12, 2024 10:24 Destroyed
@VincentSmedinga
Copy link
Contributor Author

Superseded by #1605.

@VincentSmedinga VincentSmedinga deleted the chore/DES-802-visualise-grid-in-docs branch September 26, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants