Skip to content

Commit

Permalink
fix(css): add fit-content value to size properties (mdn#29849)
Browse files Browse the repository at this point in the history
fix(css): add fit-content value to size properteis
  • Loading branch information
OnkarRuikar authored Oct 27, 2023
1 parent 5f56a84 commit 925b2bd
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 10 deletions.
1 change: 1 addition & 0 deletions files/en-us/web/css/block-size/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ block-size: 75%;
/* Keyword values */
block-size: max-content;
block-size: min-content;
block-size: fit-content;
block-size: fit-content(20em);
block-size: auto;

Expand Down
9 changes: 5 additions & 4 deletions files/en-us/web/css/height/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ height: 75%;
/* Keyword values */
height: max-content;
height: min-content;
height: fit-content;
height: fit-content(20em);
height: auto;

Expand All @@ -51,11 +52,11 @@ height: unset;
- `min-content`
- : The intrinsic minimum height.
- `fit-content`
- : Box will use the available space, but never more than `max-content`
- `fit-content({{cssxref("<length-percentage>")}})`
- : Uses the fit-content formula with the available space replaced by the specified argument, i.e. `min(max-content, max(min-content, <length-percentage>))`
- : Use the available space, but not more than [max-content](/en-US/docs/Web/CSS/max-content), i.e `min(max-content, max(min-content, stretch))`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})` {{Experimental_Inline}}
- : Uses the fit-content formula with the available space replaced by the specified argument, i.e. `min(max-content, max(min-content, <length-percentage>))`.
- {{cssxref("clamp", "clamp()")}}
- : Enables selecting a middle value within a range of values between a defined minimum and maximum
- : Enables selecting a middle value within a range of values between a defined minimum and maximum.

## Accessibility concerns

Expand Down
1 change: 1 addition & 0 deletions files/en-us/web/css/inline-size/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ inline-size: 75%;
/* Keyword values */
inline-size: max-content;
inline-size: min-content;
inline-size: fit-content;
inline-size: fit-content(20em);
inline-size: auto;

Expand Down
5 changes: 4 additions & 1 deletion files/en-us/web/css/max-block-size/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ max-block-size: 75%;
max-block-size: none;
max-block-size: max-content;
max-block-size: min-content;
max-block-size: fit-content;
max-block-size: fit-content(20em);

/* Global values */
Expand All @@ -55,7 +56,9 @@ The `max-block-size` property's value can be any value that's legal for the {{cs
- : The intrinsic preferred `max-block-size`.
- `min-content`
- : The intrinsic minimum `max-block-size`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})`
- `fit-content`
- : Use the available space, but not more than [max-content](/en-US/docs/Web/CSS/max-content), i.e `min(max-content, max(min-content, stretch))`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})` {{Experimental_Inline}}
- : Uses the `fit-content` formula with the available space replaced by the specified argument, i.e. `min(max-content, max(min-content, argument))`.

### How writing-mode affects directionality
Expand Down
5 changes: 4 additions & 1 deletion files/en-us/web/css/max-height/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ max-height: 75%;
max-height: none;
max-height: max-content;
max-height: min-content;
max-height: fit-content;
max-height: fit-content(20em);

/* Global values */
Expand All @@ -48,7 +49,9 @@ max-height: unset;
- : The intrinsic preferred `max-height`.
- `min-content`
- : The intrinsic minimum `max-height`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})`
- `fit-content`
- : Use the available space, but not more than [max-content](/en-US/docs/Web/CSS/max-content), i.e `min(max-content, max(min-content, stretch))`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})` {{Experimental_Inline}}
- : Uses the `fit-content` formula with the available space replaced by the specified argument, i.e. `min(max-content, max(min-content, argument))`.

## Accessibility concerns
Expand Down
1 change: 1 addition & 0 deletions files/en-us/web/css/max-inline-size/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ max-inline-size: 75%;
max-inline-size: none;
max-inline-size: max-content;
max-inline-size: min-content;
max-inline-size: fit-content;
max-inline-size: fit-content(20em);

/* Global values */
Expand Down
5 changes: 4 additions & 1 deletion files/en-us/web/css/max-width/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ max-width: 75%;
max-width: none;
max-width: max-content;
max-width: min-content;
max-width: fit-content;
max-width: fit-content(20em);

/* Global values */
Expand All @@ -48,7 +49,9 @@ max-width: unset;
- : The intrinsic preferred `max-width`.
- `min-content`
- : The intrinsic minimum `max-width`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})`
- `fit-content`
- : Use the available space, but not more than [max-content](/en-US/docs/Web/CSS/max-content), i.e `min(max-content, max(min-content, stretch))`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})` {{Experimental_Inline}}
- : Uses the `fit-content` formula with the available space replaced by the specified argument, i.e. `min(max-content, max(min-content, argument))`.

## Accessibility concerns
Expand Down
1 change: 1 addition & 0 deletions files/en-us/web/css/min-block-size/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ min-block-size: 10%;
/* Keyword values */
min-block-size: max-content;
min-block-size: min-content;
min-block-size: fit-content;
min-block-size: fit-content(20em);

/* Global values */
Expand Down
5 changes: 4 additions & 1 deletion files/en-us/web/css/min-height/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ min-height: 10%;
/* Keyword values */
min-height: max-content;
min-height: min-content;
min-height: fit-content;
min-height: fit-content(20em);

/* Global values */
Expand All @@ -47,7 +48,9 @@ min-height: unset;
- : The intrinsic preferred `min-height`.
- `min-content`
- : The intrinsic minimum `min-height`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})`
- `fit-content`
- : Use the available space, but not more than [max-content](/en-US/docs/Web/CSS/max-content), i.e `min(max-content, max(min-content, stretch))`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})` {{Experimental_Inline}}
- : Uses the `fit-content` formula with the available space replaced by the specified argument, i.e. `min(max-content, max(min-content, argument))`.

## Formal definition
Expand Down
1 change: 1 addition & 0 deletions files/en-us/web/css/min-inline-size/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ min-inline-size: 10%;
/* Keyword values */
min-inline-size: max-content;
min-inline-size: min-content;
min-inline-size: fit-content;
min-inline-size: fit-content(20em);

/* Global values */
Expand Down
5 changes: 4 additions & 1 deletion files/en-us/web/css/min-width/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ min-width: 10%;
/* Keyword values */
min-width: max-content;
min-width: min-content;
min-width: fit-content;
min-width: fit-content(20em);

/* Global values */
Expand All @@ -47,7 +48,9 @@ min-width: unset;
- : The intrinsic preferred `min-width`.
- `min-content`
- : The intrinsic minimum `min-width`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})`
- `fit-content`
- : Use the available space, but not more than [max-content](/en-US/docs/Web/CSS/max-content), i.e `min(max-content, max(min-content, stretch))`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})` {{Experimental_Inline}}
- : Uses the `fit-content` formula with the available space replaced by the specified argument, i.e. `min(max-content, max(min-content, argument))`.

## Formal definition
Expand Down
5 changes: 4 additions & 1 deletion files/en-us/web/css/width/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ width: 75%;
/* Keyword values */
width: max-content;
width: min-content;
width: fit-content;
width: fit-content(20em);
width: auto;

Expand All @@ -52,7 +53,9 @@ width: unset;
- : The intrinsic preferred width.
- `min-content`
- : The intrinsic minimum width.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})`
- `fit-content`
- : Use the available space, but not more than [max-content](/en-US/docs/Web/CSS/max-content), i.e `min(max-content, max(min-content, stretch))`.
- `fit-content({{cssxref("&lt;length-percentage&gt;")}})` {{Experimental_Inline}}
- : Uses the fit-content formula with the available space replaced by the specified argument, i.e. `min(max-content, max(min-content, <length-percentage>))`.

## Accessibility concerns
Expand Down

0 comments on commit 925b2bd

Please sign in to comment.