-
Notifications
You must be signed in to change notification settings - Fork 59
refactor: divider documentation #2978
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've lost the colored bg part, I can't remember if it was asked or not 🤔
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have some examples in the color section, isn't it enough? |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,78 @@ | ||||||||
| --- | ||||||||
| layout: docs | ||||||||
| title: Divider | ||||||||
| description: Use the horizontal or vertical rule helpers to create dividers. A divider can be used to visually structure an interface by clearly separating content sections. | ||||||||
| group: helpers | ||||||||
| aliases: | ||||||||
| - "/docs/helpers/divider/" | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add ? for links compatibility
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /docs/helpers/dividers only exist since 0.4, I don't think anyone has bookmarked it yet. ;-)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a page has already been published, the file exists in the gh-pages branch. If we don't keep this alias for new versions, Hugo will not generate a new page with a redirection, and when we'll update the doc we will not overwrite the existing file. Therefore we will have the old page available on
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok noted. I add the link for compatibility |
||||||||
| - "/docs/helpers/vertical-rule/" | ||||||||
| toc: true | ||||||||
| --- | ||||||||
|
|
||||||||
| ## Horizontal rules | ||||||||
|
|
||||||||
| Horizontal rules should use the `<hr>` tag, when the separator has semantic meaning (i.e., when it represents a topic change or a significant transition in the content). If the divider is purely decorative, prefer using a border CSS property on a `<div>` or our [border utilities]({{< docsref "/utilities/borders" >}}), or even ensure to hide it from assistive technologies (e.g., `aria-hidden="true"`). | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should be less specific and say "on an element" or "on an HTML element" rather than "on a div" ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok for me, I updated the doc |
||||||||
|
|
||||||||
| {{< example >}} | ||||||||
| <hr> | ||||||||
| <div class="border-top border-default my-medium"></div> | ||||||||
| {{< /example >}} | ||||||||
|
|
||||||||
| ## Vertical rules | ||||||||
|
|
||||||||
| Vertical rules are inspired by the `<hr>` element. The `vr` class allows you to create vertical dividers in common layouts. They're styled just like `<hr>` elements. They have `min-height` of `1em`. | ||||||||
|
|
||||||||
| {{< example >}} | ||||||||
| <div class="vr"></div> | ||||||||
| {{< /example >}} | ||||||||
|
|
||||||||
| Vertical rules scale their height in flex layouts: | ||||||||
|
|
||||||||
| {{< example class="d-flex" >}} | ||||||||
| <div class="d-flex" style="height: 50px;"> | ||||||||
| <div class="vr"></div> | ||||||||
| </div> | ||||||||
| <div class="d-flex" style="height: 80px;"> | ||||||||
| <div class="vr"></div> | ||||||||
| </div> | ||||||||
| <div class="d-flex" style="height: 100px;"> | ||||||||
| <div class="vr"></div> | ||||||||
| </div> | ||||||||
| {{< /example >}} | ||||||||
|
|
||||||||
| ## Color | ||||||||
|
|
||||||||
| Change the divider color using the [border color utilities]({{< docsref "/utilities/borders/#color" >}}). | ||||||||
|
|
||||||||
| {{< example class="d-flex flex-column gap-1" >}} | ||||||||
| <div><hr class="border-muted"></div> | ||||||||
| <div><hr class="border-emphasized"></div> | ||||||||
| <div><hr class="border-brand-primary"></div> | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could remove the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok done |
||||||||
| <div data-bs-theme="light" class="bg-brand-primary py-shortest"><hr class="border-on-brand-primary"></div> | ||||||||
| <div data-bs-theme="light" class="bg-always-white py-shortest"><hr class="border-always-black"></div> | ||||||||
| <div data-bs-theme="dark" class="bg-always-black py-shortest"><hr class="border-always-white"></div> | ||||||||
| <div data-bs-theme="dark" class="bg-always-black py-shortest"><hr class="border-always-on-black"></div> | ||||||||
| <div data-bs-theme="light" class="bg-always-white py-shortest"><hr class="border-always-on-white"></div> | ||||||||
| {{< /example >}} | ||||||||
|
louismaximepiton marked this conversation as resolved.
|
||||||||
|
|
||||||||
| {{< bootstrap-compatibility >}} | ||||||||
| The `<hr>` and `vr` color can be set using [colors utilities]({{< docsref "/utilities/colors" >}}) | ||||||||
| {{< example >}} | ||||||||
| <hr class="text-brand-emphazied"> | ||||||||
| <div class="vr text-brand-primary"></div> | ||||||||
| {{< /example >}} | ||||||||
| {{< /bootstrap-compatibility >}} | ||||||||
|
|
||||||||
| ## Size | ||||||||
|
|
||||||||
| Change the divider thickness using the [border width utilities]({{< docsref "/utilities/borders/#width" >}}). | ||||||||
|
|
||||||||
| {{< example>}} | ||||||||
| <div class="d-flex" style="height: 50px;"> | ||||||||
| <div class="vr border-thin"></div> | ||||||||
| <div class="vr border-medium"></div> | ||||||||
| <div class="vr border-thick"></div> | ||||||||
| <div class="vr border-thicker"></div> | ||||||||
| </div> | ||||||||
| {{< /example >}} | ||||||||
|
louismaximepiton marked this conversation as resolved.
|
||||||||
|
|
||||||||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.