-
Notifications
You must be signed in to change notification settings - Fork 114
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
feat(website): aspect-ratio docs page #104
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://paste-git-aspect-ratio-doc-page.twilio-dsys.now.sh |
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
Aspect Ratio can also be used to embed components, or other HTML elements that | ||
needs to be set to a specific height-to-width ratio. A component or other HTML | ||
element use case is the need to align an HTML element with an image in two columns. | ||
See examples. |
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, lets just insert an example directly after these 2 paras. This example could be a component example.
|
||
### Examples | ||
|
||
<LivePreview scope={{Absolute, AspectRatio, Box}} language="jsx"> |
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 then drop this, dangling example
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 moved the color swatch example under the paragraph that discusses it.
@@ -20,6 +20,14 @@ const globalStyles = css` | |||
margin: 0; | |||
font-size: 14px; | |||
} | |||
|
|||
iframe { |
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 added this here for now as global style. It makes iframe embeds actually work with Aspect Ratio. We should probably just move this to the default styles for Aspect Ratio. Thoughts? @TheSisb @SiTaggart
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 don't like this as a global style, it doesn't scale to non-AspectRatio iframes.
I think you just have to make a new component and put the styles there.
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.
hmmm I feel like the expectation from reading the docs is that it should "just work", so maybe it belongs to the Aspect Ratio. Do you need to do the same thing for an image? What's the least amount of work for a consumer to do for all cases?
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.
It's probably safe to do something like > :first-child
here.
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.
@SiTaggart you're right. It should "just work". I'm going to move that style over to the Aspect Ratio where it should be. I think if that component was kicked off properly, we would have caught that. Image is much simpler:
<AspectRatio ratio="4:3">
<img src="" />
</AspectRatio>
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.
Added embed, iframe, object, video styles to Aspect Ration in the latest commit.
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.
LGTM 👍
packages/paste-website/src/pages/utilities/aspect-ratio/index.mdx
Outdated
Show resolved
Hide resolved
Feedback has been complete, but Shadi is sick
anchor
andbutton
doc pagesanchor
andbutton
doc pagesGatsby-Image
doesn't play well with ourLivePreview
component, so I opted to not use theLivePreview
for the image/component example.Contributing to Twilio