Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/content/docs/0.4/content/reboot.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ The `<hr>` element has been simplified. Similar to browser defaults, `<hr>`s are
<hr>
{{< /example >}}

The `<hr>` style can be modified with border utilities. See some customization examples in the [dividers helpers]({{< docsref "/helpers/dividers" >}}) documentation.
The `<hr>` style can be modified with border utilities. See some customization examples in the [Divider helpers]({{< docsref "/helpers/divider" >}}) documentation.

<!-- ## Lists

Expand Down
99 changes: 99 additions & 0 deletions site/content/docs/0.4/helpers/divider.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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,99 @@
---
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/"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add ? for links compatibility

Suggested change
- "/docs/helpers/divider/"
- "/docs/helpers/divider/"
- "/docs/helpers/dividers/"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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 /dividers/ and the new one on /divider/. I would keep the alias, even if you're not wrong, nobody should have bookmarked the page.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok noted. I add the link for compatibility

- "/docs/helpers/dividers/"
- "/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 an HTML element or our [border utilities]({{< docsref "/utilities/borders" >}}), or even ensure to hide it from assistive technologies (e.g., `aria-hidden="true"`).

{{< 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" >}}
<hr class="border-muted">
<hr class="border-emphasized">
<hr class="border-brand-primary">
<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 >}}
Comment thread
louismaximepiton marked this conversation as resolved.

{{< example class="d-flex gap-1" >}}
<div class="vr border-muted"></div>
<div class="vr border-emphasized"></div>
<div class="vr border-brand-primary"></div>
<div data-bs-theme="light" class="d-flex bg-brand-primary"><div class="vr border-on-brand-primary"></div></div>
<div data-bs-theme="light" class="d-flex bg-always-white px-shortest"><div class="vr border-always-black"></div></div>
<div data-bs-theme="dark" class="d-flex bg-always-black px-shortest"><div class="vr border-always-white"></div></div>
<div data-bs-theme="dark" class="d-flex bg-always-black px-shortest"><div class="vr border-always-on-black"></div></div>
<div data-bs-theme="light" class="d-flex bg-always-white px-shortest"><div class="vr border-always-on-white"></div></div>
{{< /example >}}

{{< bootstrap-compatibility >}}
The `<hr>` and `vr` color can be set using [colors utilities]({{< docsref "/utilities/colors" >}})
{{< example >}}
<hr class="text-muted">
<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>
<hr class="border-thin">
<hr class="border-medium">
<hr class="border-thick">
<hr class="border-thicker">
</div>
{{< /example >}}

{{< 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 >}}
Comment thread
louismaximepiton marked this conversation as resolved.

86 changes: 0 additions & 86 deletions site/content/docs/0.4/helpers/dividers.md

This file was deleted.

2 changes: 1 addition & 1 deletion site/content/docs/0.4/helpers/stacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Using horizontal margin utilities like `.ms-auto` as spacers:
</div>
{{< /example >}}

And with [vertical rules]({{< docsref "/helpers/dividers" >}}):
And with [vertical rules]({{< docsref "/helpers/divider" >}}):

{{< example class="bd-example-flex" >}}
<div class="hstack gap-tall">
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/0.4/migration-from-boosted.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ See [our new Switch page]({{< docsref "/forms/switch" >}}) for more information.

- <span class="badge text-bg-status-negative-emphasized">Breaking</span> All colored links helpers are unstyled in OUDS Web. Classes still exist for Bootstrap compatibility.

### Dividers
### Divider

- <span class="badge text-bg-status-positive-emphasized">New</span> Horizontal or vertical rule helpers to create dividers.

Expand All @@ -299,7 +299,7 @@ See [our new Switch page]({{< docsref "/forms/switch" >}}) for more information.

### Vertical rule

- <span class="badge text-bg-status-warning-emphasized">Warning</span> The vertical rule documentation has been merged into the new [Dividers helper]({{< docsref "/helpers/dividers" >}}) documentation.
- <span class="badge text-bg-status-warning-emphasized">Warning</span> The vertical rule documentation has been merged into the new [Divider helper]({{< docsref "/helpers/divider" >}}) documentation.

## Utilities

Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/0.4/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ toc: true

### Helpers

#### Dividers
#### Divider
- <span class="badge text-bg-status-positive-emphasized">New</span> Horizontal and vertical rule helpers to create dividers.

### CSS and Sass variables
Expand Down
2 changes: 1 addition & 1 deletion site/data/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
- title: Clearfix
- title: Color & background
- title: Colored links
- title: Dividers
- title: Divider
- title: Focus ring
draft: true
- title: Position
Expand Down