From e304328613d8216a8b2852267a72ee78317c84c4 Mon Sep 17 00:00:00 2001 From: Daniel Olabemiwo Date: Sun, 4 Jun 2023 21:10:09 +0100 Subject: [PATCH 1/4] docs(container): add container documentation --- .../examples/container/ContainerCenter.vue | 14 ++++ .../examples/container/ContainerSize.vue | 17 ++++ .../examples/container/SimpleContainer.vue | 12 +++ content/4.components/container.md | 78 +++++++++++++++++++ 4 files changed, 121 insertions(+) create mode 100644 components/content/examples/container/ContainerCenter.vue create mode 100644 components/content/examples/container/ContainerSize.vue create mode 100644 components/content/examples/container/SimpleContainer.vue create mode 100644 content/4.components/container.md diff --git a/components/content/examples/container/ContainerCenter.vue b/components/content/examples/container/ContainerCenter.vue new file mode 100644 index 0000000..d4156da --- /dev/null +++ b/components/content/examples/container/ContainerCenter.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/content/examples/container/ContainerSize.vue b/components/content/examples/container/ContainerSize.vue new file mode 100644 index 0000000..0a67ee0 --- /dev/null +++ b/components/content/examples/container/ContainerSize.vue @@ -0,0 +1,17 @@ + + + diff --git a/components/content/examples/container/SimpleContainer.vue b/components/content/examples/container/SimpleContainer.vue new file mode 100644 index 0000000..386c715 --- /dev/null +++ b/components/content/examples/container/SimpleContainer.vue @@ -0,0 +1,12 @@ + + + diff --git a/content/4.components/container.md b/content/4.components/container.md new file mode 100644 index 0000000..a366b16 --- /dev/null +++ b/content/4.components/container.md @@ -0,0 +1,78 @@ +--- +title: Container +description: + Container component is used to constrain a content's width to the current breakpoint, while keeping it fluid. +version: 2.0+ +--- + +# Container + +Containers are used to constrain a content's width to the current breakpoint, while keeping it fluid. + +## Import + +```js +import { CContainer } from '@chakra-ui/vue-next' +``` + +## Usage + +To contain any piece of content, wrap it in the `Container` component. + +::showcase + ::simple-container + :: +:: + +```html + + There are many benefits to a joint design and development system. Not only + does it bring benefits to the design team, but it also brings benefits to + engineering teams. It makes sure that our experiences have a consistent look + and feel, not just in our design specs, but in production + +``` + +### Container Size + +By default, the `Container` component sets the `maxWidth` of the content to 60 characters (`60ch`) but you can customize this by passing custom `maxWidth` values or changing the size tokens. + +> * About the default value: The `ch` unit is a relative unit defined by the rendered typeface's "0" character width. This width varies by the shape and style of the font. +> * If you are curious about the reason for this default value of `60` characters, consider this explanation about [line length](https://betterwebtype.com/articles/2019/06/16/5-keys-to-accessible-web-typography/#line-length) from Better Web Type. + +::showcase + ::container-size + :: +:: + +```html + + + "md" Container + + + "550px" Container + + + "container.sm" Container + + +``` + +### Centering the children + +In some cases, the width of the content can be smaller than the container's width. You can use the `centerContent` prop to center the content. It renders a flexbox with `flexDirection` set to `column` and `alignItems` set to `center`. +::showcase + ::container-center +:: + +```html + + + There are many benefits to a joint design and development system. Not only + does it bring benefits to the design team, but it also brings benefits to + engineering teams. It makes sure that our experiences have a consistent look + and feel, not just in our design specs, but in production. + + +``` From 724625d64d0e39e63f416a09ec1a7550bc2280c0 Mon Sep 17 00:00:00 2001 From: Daniel Olabemiwo Date: Fri, 9 Jun 2023 16:15:24 +0100 Subject: [PATCH 2/4] chore: PR fixes --- .../examples/container/ContainerCenter.vue | 4 ++-- .../content/examples/container/ContainerSize.vue | 6 +++--- content/4.components/container.md | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/components/content/examples/container/ContainerCenter.vue b/components/content/examples/container/ContainerCenter.vue index d4156da..863c7d5 100644 --- a/components/content/examples/container/ContainerCenter.vue +++ b/components/content/examples/container/ContainerCenter.vue @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/components/content/examples/container/SimpleContainer.vue b/components/content/examples/container/SimpleContainer.vue index 386c715..97b5719 100644 --- a/components/content/examples/container/SimpleContainer.vue +++ b/components/content/examples/container/SimpleContainer.vue @@ -1,12 +1,8 @@ - - + + \ No newline at end of file