Skip to content

Commit 13706cc

Browse files
authored
feat: add max width on native ul, ol and dl (#3277)
1 parent c1af980 commit 13706cc

File tree

8 files changed

+12
-9
lines changed

8 files changed

+12
-9
lines changed

scss/_breadcrumb.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
// End mod
1010
// scss-docs-end breadcrumb-css-vars
1111

12+
@include list-unstyled();
1213
display: flex;
13-
padding: 0;
14-
list-style: none;
1514
@include get-font-size("label-medium");
1615

1716
.breadcrumb-item {

scss/_navbar.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,14 @@
207207
--#{$prefix}nav-link-disabled-color: var(--#{$prefix}navbar-disabled-color);
208208
// scss-docs-end navbar-nav-css-vars
209209

210+
@include list-unstyled(); // OUDS mod
210211
display: flex;
211212
flex-direction: column; // cannot use `inherit` to get the `.navbar`s value
212213
padding: var(--#{$prefix}navbar-nav-padding-top) var(--#{$prefix}navbar-nav-padding-x) var(--#{$prefix}navbar-nav-padding-bottom); // OUDS mod
213214
margin-bottom: 0;
214215
@include font-size(var(--#{$prefix}navbar-nav-font-size)); // OUDS mod
215216
line-height: var(--#{$prefix}navbar-nav-line-height, $line-height-base); // OUDS mod
216217
letter-spacing: var(--#{$prefix}navbar-nav-letter-spacing, $letter-spacing-base); // OUDS mod
217-
@include list-unstyled(); // OUDS mod
218-
219218
// OUDS mod: Handle .nav-link and .nav-icon slightly differently than Bs
220219
.nav-link {
221220
position: relative;

scss/_reboot.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ address {
200200
ol,
201201
ul,
202202
dl {
203+
max-width: var(--#{$prefix}font-max-width-body-medium);
203204
margin-top: 0;
204205
margin-bottom: 1rem;
205206
}

scss/mixins/_lists.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// Unstyled keeps list items block level, just removes default browser padding and list-style
44
@mixin list-unstyled {
5+
max-width: initial;
56
padding-left: 0;
67
list-style: none;
78
}

site/src/content/docs/components/bullet-list.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ Add `.fw-normal` to the top `ul` to use a normal font weight.
288288
289289
### Unstyled
290290
291-
Remove the default `list-style` and left margin on list items (immediate children only). **This only applies to immediate children list items**, meaning you will need to add the class for any nested lists as well.
291+
Remove the default `list-style`, left margin and `max-width` on lists (immediate children only). **This only applies to immediate children list items**, meaning you will need to add the class for any nested lists as well.
292292
293293
<Example code={`<ul class="list-unstyled">
294294
<li>This is a list.</li>
@@ -321,7 +321,7 @@ Remove a list's bullets and apply some light `margin` with a combination of two
321321
Only use this where you can not add a class to `<ul>` and `<ol>`.
322322
</Callout>
323323
324-
All lists—`<ul>`, `<ol>`, and `<dl>`—have their `margin-top` removed and a `margin-bottom: 1rem`. Nested lists have no `margin-bottom`. We've also reset the `padding-left` on `<ul>` and `<ol>` elements.
324+
All lists—`<ul>`, `<ol>`, and `<dl>`—have their `margin-top` removed and a `margin-bottom: 1rem`, they also have a `max-width` set to `--bs-font-max-width-body-medium`. Nested lists have no `margin-bottom`. We've also reset the `padding-left` on `<ul>` and `<ol>` elements.
325325
326326
<Example showMarkup={false} code={`<ul>
327327
<li>All lists have their top margin removed</li>

site/src/content/docs/migrations/migration-from-boosted.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ All responsive classes, helpers, and utilities have been updated accordingly to
102102

103103
- <span class="tag tag-small rounded-none tag-positive">New</span> `.bullet-list`, `.bullet-list-default-color`, `.bullet-list-tick` and `.bullet-list-bare` classes have been added.
104104
- <span class="tag tag-small rounded-none tag-negative">Breaking</span> `.bullet-list` is mandatory for a full Bullet list component as defined in OUDS.
105+
- <span class="tag tag-small rounded-none tag-warning">Warning</span> Native `<ul>`, `<ol>` and `<dl>` now have a `max-width` set to the variable `--bs-font-max-width-body-medium`.
105106

106107
### Close button
107108

site/src/content/docs/migrations/migration.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ toc: true
5454

5555
- <span class="tag tag-small rounded-none tag-negative">Breaking</span> `.btn-rounded` has been replaced by a global `.use-rounded-corner-buttons`. Read more in our [buttons page]([[docsref:/components/buttons#rounded]]).
5656

57+
### Reboot
58+
59+
- <span class="tag tag-small rounded-none tag-warning">Warning</span> Native `<ul>`, `<ol>` and `<dl>` now have a `max-width` set to the variable `--bs-font-max-width-body-medium`.
60+
5761
### Utilities
5862

5963
#### Background

site/src/scss/_toc.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
@include get-font-size("label-medium"); // OUDS mod: instead of `.875rem`
1818

1919
ul {
20-
padding-left: 0;
21-
margin-bottom: 0;
22-
list-style: none;
2320
@include list-unstyled(); // OUDS mod
21+
margin-bottom: 0;
2422

2523
ul {
2624
padding-left: 1rem;

0 commit comments

Comments
 (0)