-
Notifications
You must be signed in to change notification settings - Fork 81
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
fix: improved collapsable examples #1874
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/contentful-apps/forma-36/E5Vt7FL1VH3f7m9PLJuWehZBzASg |
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.
Wow! Looks really cool
I have a couple of suggestions but they are not blockers 🙌
@@ -17,7 +17,7 @@ import { Card, Button, CopyButton } from '@contentful/f36-components'; | |||
import * as f36icons from '@contentful/f36-icons'; | |||
import { ExternalLinkIcon } from '@contentful/f36-icons'; | |||
import { Flex } from '@contentful/f36-core'; | |||
import theme from 'prism-react-renderer/themes/github'; | |||
import github from 'prism-react-renderer/themes/github'; |
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 would rename this "githubTheme" just to avoid confusion
size="small" | ||
/> | ||
{isExampleFromFile && ( | ||
<Flex marginLeft="spacing2Xs"> |
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.
we don't need this Flex I think
we can use gap
in the Flex containing these buttons
@@ -3,7 +3,7 @@ import React from 'react'; | |||
import Highlight, { | |||
defaultProps as HighlightDefaultProps, | |||
} from 'prism-react-renderer'; | |||
import theme from 'prism-react-renderer/themes/github'; | |||
import github from 'prism-react-renderer/themes/github'; |
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.
Same comment as before
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.
Love the styles of hidden code and an 👁 button. ⭐️
Maybe we can have them all collapsed by default since the part of the code is visible even in collapsed state, wdyt? I remember we had all collapsed before v4
font-size: ${tokens.fontSizeM}; | ||
line-height: ${tokens.lineHeightM}; |
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.
Do we really want to have code in the code blocks smaller? For me, it's a bit inconvenient right now to read it.
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.
Yeah, that was the requirement from design.
In the next PR we will provide a custom template for examples, it will be a bit darker.