Skip to content
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

Editorial review: CSS anchor positioning 5: position try functionality #33609

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

chrisdavidmills
Copy link
Contributor

@chrisdavidmills chrisdavidmills commented May 14, 2024

Description

CSS Anchor Positioning is set to be released in Chrome 125 (see the associated Chrome Status entry).

This PR (part of a series; see the first PR here) adds the following content:

  • The position-try-options property
  • The inset-area() function (only needs to be a short stub page)
  • The position-try-order property
  • The position-try shorthand property
  • The @position-try at-rule
  • The CSSPositionTryRule CSSOM interface and its properties:
    • name
    • style
  • The CSSPositionTryDescriptors CSSOM interface.

Do not merge until #33058 is merged.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner May 14, 2024 14:40
@chrisdavidmills chrisdavidmills requested review from estelle and removed request for a team May 14, 2024 14:40
@chrisdavidmills chrisdavidmills marked this pull request as draft May 14, 2024 14:40
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label May 14, 2024
@chrisdavidmills chrisdavidmills removed the request for review from estelle May 14, 2024 14:40
@github-actions github-actions bot added the size/m 51-500 LoC changed label May 14, 2024
Copy link
Contributor

github-actions bot commented May 14, 2024

Preview URLs (10 pages)
Flaws (49)

URL: /en-US/docs/Web/API/CSSPositionTryRule
Title: CSSPositionTryRule
Flaw count: 2

  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using

URL: /en-US/docs/Web/API/CSSPositionTryRule/name
Title: CSSPositionTryRule: name property
Flaw count: 2

  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using

URL: /en-US/docs/Web/API/CSSPositionTryRule/style
Title: CSSPositionTryRule: style property
Flaw count: 2

  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using

URL: /en-US/docs/Web/API/CSSPositionTryDescriptors
Title: CSSPositionTryDescriptors
Flaw count: 4

  • macros:
    • /en-US/docs/Web/CSS/inset-area does not exist
    • /en-US/docs/Web/CSS/position-anchor does not exist
  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using

URL: /en-US/docs/Web/API/CSS_Object_Model
Title: CSS Object Model (CSSOM)
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/CSSFontFeatureValuesMap does not exist
    • /en-US/docs/Web/API/CSSMarginRule does not exist

URL: /en-US/docs/Web/CSS/inset-area_function
Title: inset-area()
Flaw count: 7

  • macros:
    • /en-US/docs/Web/CSS/inset-area does not exist
    • /en-US/docs/Web/CSS/inset-area does not exist
    • /en-US/docs/Web/CSS/inset-area does not exist
  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using

URL: /en-US/docs/Web/CSS/@position-try
Title: @position-try
Flaw count: 14

  • macros:
    • /en-US/docs/Web/CSS/position-anchor does not exist
    • /en-US/docs/Web/CSS/anchor-name does not exist
    • /en-US/docs/Web/CSS/inset-area does not exist
    • /en-US/docs/Web/CSS/anchor-name does not exist
    • /en-US/docs/Web/CSS/inset-area does not exist
    • and 2 more flaws omitted
  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using
    • Can't resolve /en-US/docs/Web/CSS/anchor
    • Can't resolve /en-US/docs/Web/CSS/anchor-size
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using#centering_on_the_anchor_using_anchor-center
    • and 2 more flaws omitted

URL: /en-US/docs/Web/CSS/position-try-options
Title: position-try-options
Flaw count: 8

  • macros:
    • /en-US/docs/Web/CSS/inset-area does not exist
    • /en-US/docs/Web/CSS/position-visibility does not exist
    • /en-US/docs/Web/CSS/anchor-name does not exist
    • /en-US/docs/Web/CSS/position-anchor does not exist
  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using

URL: /en-US/docs/Web/CSS/position-try
Title: position-try
Flaw count: 3

  • macros:
    • /en-US/docs/Web/CSS/anchor-name does not exist
  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using

URL: /en-US/docs/Web/CSS/position-try-order
Title: position-try-order
Flaw count: 5

  • macros:
    • /en-US/docs/Web/CSS/anchor-name does not exist
  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning
    • Can't resolve /en-US/docs/Web/CSS/CSS_anchor_positioning/Using

(comment last updated: 2024-06-04 02:08:10)

@github-actions github-actions bot added size/l 501-1000 LoC changed and removed size/m 51-500 LoC changed labels May 15, 2024
@github-actions github-actions bot added Content:WebAPI Web API docs size/xl >1000 LoC changed and removed size/l 501-1000 LoC changed labels May 16, 2024
@chrisdavidmills chrisdavidmills marked this pull request as ready for review May 16, 2024 09:33
@chrisdavidmills chrisdavidmills requested a review from a team as a code owner May 16, 2024 09:33
@chrisdavidmills chrisdavidmills requested review from wbamberg and removed request for a team and wbamberg May 16, 2024 09:33
Copy link

@mfreed7 mfreed7 left a comment

Choose a reason for hiding this comment

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

LGTM!

files/en-us/web/css/position-try-order/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/position-try-order/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/position-try-order/index.md Outdated Show resolved Hide resolved
@chrisdavidmills chrisdavidmills requested review from estelle and removed request for mfreed7 May 21, 2024 08:17
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

partial review.


_Inherits properties from its ancestor {{domxref("CSSStyleDeclaration")}}._

The `CSSPositionTryDescriptors` interface defines around 70 properties that represent all of the [possible CSS properties that can be set inside a `@position-try` at rule](/en-US/docs/Web/CSS/@position-try#declaration-list). It wouldn't be practical or useful to create a separate reference page for each of these properties, but you can find a full list in the [Browser compatibility](#browser_compatibility) section below.
Copy link
Member

Choose a reason for hiding this comment

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

There are about 35 properties, each presented in camelCase and css-case.

This

Suggested change
The `CSSPositionTryDescriptors` interface defines around 70 properties that represent all of the [possible CSS properties that can be set inside a `@position-try` at rule](/en-US/docs/Web/CSS/@position-try#declaration-list). It wouldn't be practical or useful to create a separate reference page for each of these properties, but you can find a full list in the [Browser compatibility](#browser_compatibility) section below.
The `CSSPositionTryDescriptors` interface defines 70 properties that represent the [CSS properties that can be set inside a `@position-try` at rule](/en-US/docs/Web/CSS/@position-try#declaration-list).
There are 35 CSS properties that can be accessed as CSS property names or camelCase.
- `CSSPositionTryDescriptors.propertyName`
- : Represents the property value set in the `@position-try` at rule using the camel-cased property name.
- `CSSPositionTryDescriptors["property-name"]`
- : Represents the property value set in the `@position-try` at rule using the CSS property name.
The instance properties are listed below:
| CSS property | camelCase | property-name |
|. ---- | ---- | ------ |
| {{cssxref("align-self")}} | `CSSPositionTryDescriptors.alignSelf` | `CSSPositionTryDescriptors["align-self"]` |

list all 35. Don't send people to decipher the BCD table.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hoping to avoid having to do this ;-)

But yeah, you are right. I'll suck it up.


- {{cssxref("@position-try")}}
- {{cssxref("position-try-options")}}
- [CSS Anchor Positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- [CSS Anchor Positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning)
- [CSS anchor positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning) module

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

let myRules = document.styleSheets[0].cssRules;
let tryOptionStyles = myRules[0].style; // a CSSPositionTryDescriptors object
console.log(tryOptionStyles.margin); // Logs "0 0 0 10px" to the console.
console.log(tryOptionStyles.insetArea); // Logs "right" to the console.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log(tryOptionStyles.insetArea); // Logs "right" to the console.
console.log(tryOptionStyles["inset-area"]); // Logs "right" to the console.

there are 35 properties, each listed two ways, so let's include at least one example of each way of accessing the CSS property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call; done.

- {{cssxref("@position-try")}}
- {{cssxref("position-try-options")}}
- [CSS Anchor Positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning)
- [Using CSS Anchor Positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- [Using CSS Anchor Positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using)
- [Using CSS Anchor Positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using)
- {{DOMxRef("CSSPositionTryRule")}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

Comment on lines 59 to 60
- [CSS Anchor Positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning)
- [Using CSS Anchor Positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using)
Copy link
Member

Choose a reason for hiding this comment

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

sentence case. add module after the module link. (for all the pages)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, done, for all the pages of this interface.


#### Result

Scroll the page and check out the effect of these position try options as the anchor nears the edge of the viewport:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Scroll the page and check out the effect of these position try options as the anchor nears the edge of the viewport:
Scroll the page and notice the effect as different position options are applied as the anchor nears the edge of the viewport:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seemed a bit awkward to me. I ended up change it to:

Scroll the page and notice the change in the positioned element's placement as the anchor nears the different edges of the viewport. This is due to different position options being applied.


Let's talk through how these position options work:

- First of all, note that our default position is defined by `inset-area: top`, so the infobox sits above the anchor. We also give the infobox a fixed width and some bottom margin so it doesn't sit right next to the anchor.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- First of all, note that our default position is defined by `inset-area: top`, so the infobox sits above the anchor. We also give the infobox a fixed width and some bottom margin so it doesn't sit right next to the anchor.
- First of all, note that our default position is defined by `inset-area: top`; the infobox sits above the anchor when the infobox would not otherwise overflow the page in any direction. Also note that the infobox has a fixed width and bottom margin set. These values will change as different position options get applied.

also add something to the effect of:

It's important to note that if the original position, in this case set with inset-area, isn't overflowing, the position-try-options property, and therefore the position options, are ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed the suggested wording a little bit here, and included wording to cover your second point. I ended up with:

First of all, note that our default position is defined by inset-area: top. When the infobox isn't overflowing the page in any direction, the infobox sits above the anchor, and the position try options set in the position-try-options property are ignored. Also note that the infobox has a fixed width and bottom margin set. These values will change as different position try options are applied.

Let's talk through how these position options work:

- First of all, note that our default position is defined by `inset-area: top`, so the infobox sits above the anchor. We also give the infobox a fixed width and some bottom margin so it doesn't sit right next to the anchor.
- If the infobox starts to overflow, the browser first tries the `--custom-left` position. This moves the infobox to the left of the anchor, adjusts the margin to suit, and also gives the infobox a different width as it sits alongside the anchor.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- If the infobox starts to overflow, the browser first tries the `--custom-left` position. This moves the infobox to the left of the anchor, adjusts the margin to suit, and also gives the infobox a different width as it sits alongside the anchor.
- If the infobox starts to overflow, the browser first tries the `--custom-left` position. This moves the infobox to the left of the anchor, adjusts the margin to suit, and also gives the infobox a different width when positioned to the left of the anchor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ended up cutting this sentence down to:

If the infobox starts to overflow, the browser first tries the --custom-left position. This moves the infobox to the left of the anchor, adjusts the margin to suit, and also gives the infobox a different width.

We already say the infobox is positioned on the left of the anchor, earlier in the sentence.


- First of all, note that our default position is defined by `inset-area: top`, so the infobox sits above the anchor. We also give the infobox a fixed width and some bottom margin so it doesn't sit right next to the anchor.
- If the infobox starts to overflow, the browser first tries the `--custom-left` position. This moves the infobox to the left of the anchor, adjusts the margin to suit, and also gives the infobox a different width as it sits alongside the anchor.
- Next, the browser tries the `--custom-bottom` position. This moves the infobox to the bottom of the anchor, and sets an appropriate margin. It doesn't set a width, so the infobox returns to its default width — 200px.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Next, the browser tries the `--custom-bottom` position. This moves the infobox to the bottom of the anchor, and sets an appropriate margin. It doesn't set a width, so the infobox returns to its default width 200px.
- Next, the browser tries the `--custom-bottom` position. This moves the infobox to the bottom of the anchor, and sets an appropriate margin. It doesn't include a `width` descriptor, so the infobox returns to its default width of `200px` set by the `width` property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Updated.

- First of all, note that our default position is defined by `inset-area: top`, so the infobox sits above the anchor. We also give the infobox a fixed width and some bottom margin so it doesn't sit right next to the anchor.
- If the infobox starts to overflow, the browser first tries the `--custom-left` position. This moves the infobox to the left of the anchor, adjusts the margin to suit, and also gives the infobox a different width as it sits alongside the anchor.
- Next, the browser tries the `--custom-bottom` position. This moves the infobox to the bottom of the anchor, and sets an appropriate margin. It doesn't set a width, so the infobox returns to its default width — 200px.
- The browser next tries the `--custom-right` position. This works much the same as the `--custom-left` position, with the same width applied, but the `inset-area` and `margin` values are mirrored to place the infobox appropriately to the right.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- The browser next tries the `--custom-right` position. This works much the same as the `--custom-left` position, with the same width applied, but the `inset-area` and `margin` values are mirrored to place the infobox appropriately to the right.
- The browser next tries the `--custom-right` position. This works much the same as the `--custom-left` position, with the same `width` descriptor value applied, but the `inset-area` and `margin` values are mirrored to place the infobox appropriately to the right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good; updated

files/en-us/web/api/csspositiontrydescriptors/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/csspositiontrydescriptors/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/csspositiontrydescriptors/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/csspositiontrydescriptors/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/csspositiontrydescriptors/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/csspositiontrydescriptors/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/@position-try/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/@position-try/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/@position-try/index.md Outdated Show resolved Hide resolved
chrisdavidmills and others added 12 commits May 28, 2024 10:18
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chrisdavidmills
Copy link
Contributor Author

@estelle thanks a lot for your work on this. I've answered your comments so far.

files/en-us/web/api/csspositiontryrule/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/csspositiontryrule/index.md Outdated Show resolved Hide resolved
- [CSS anchor positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning) module
- [Using CSS anchor positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using)
- {{DOMxRef("CSSPositionTryDescriptors")}}
```
Copy link
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
```
```
```

estelle and others added 2 commits June 3, 2024 19:05
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

that's enough review for today. 7 hours!


_Inherits properties from its ancestor {{domxref("CSSStyleDeclaration")}}._

The `CSSPositionTryDescriptors` interface defines 70 properties that represent the [CSS properties that can be set inside a `@position-try` at rule](/en-US/docs/Web/CSS/@position-try#declaration-list).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The `CSSPositionTryDescriptors` interface defines 70 properties that represent the [CSS properties that can be set inside a `@position-try` at rule](/en-US/docs/Web/CSS/@position-try#declaration-list).
The `CSSPositionTryDescriptors` interface defines properties that represent the [CSS properties that can be set inside a `@position-try` at rule](/en-US/docs/Web/CSS/@position-try#declaration-list).

70 v 35 is confusing, so let's omit it.

The instance properties are listed below:

| CSS&nbsp;property | Camel-case | Property name |
| ---------------------------------- | --------------------------------------------- | -------------------------------------------------- |
Copy link
Member

Choose a reason for hiding this comment

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

should we start off with a const CSSPTD = CSSPositionTryDescriptors, so we can shorten the table?


## Examples

The CSS includes a `@position-try` at-rule with a name of `--custom-right` and several declarations in its body.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The CSS includes a `@position-try` at-rule with a name of `--custom-right` and several declarations in its body.
The CSS includes a `@position-try` at-rule with a name of `--custom-right` and three descriptors.

console.log(tryOption.style); // "[object CSSPositionTryDescriptors]"
console.log(tryOption.style.margin); // "0 0 0 10px"
console.log(tryOption.style["inset-area"]); // "right"
```
Copy link
Member

Choose a reason for hiding this comment

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

i committed this line so i could read the page

- {{cssxref("position-try-options")}}
- [CSS anchor positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning) module
- [Using CSS anchor positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using)
- {{DOMxRef("CSSPositionTryRule")}}
Copy link
Member

Choose a reason for hiding this comment

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

put the API first (since we're in APIs)

let myRules = document.styleSheets[0].cssRules;
let tryOption = myRules[0]; // a CSSPositionTryRule
console.log(tryOption.style.top); // "anchor(bottom)"
console.log(tryOption.style["min-width"]); // "100px"
Copy link
Member

Choose a reason for hiding this comment

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

add one that isn't declared to show what a value will look like when not set


For detailed information on anchor features and usage, see the [CSS anchor positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning) module landing page and the [Using CSS anchor positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using) guide.

## Syntax
Copy link
Member

Choose a reason for hiding this comment

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

change to "descriptors" and copy the https://developer.mozilla.org/en-US/docs/Web/CSS/@property format.

@@ -0,0 +1,192 @@
---
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines +56 to +57
- {{cssxref("inset-area")}}, {{cssxref("position-try-options")}}
- The {{cssxref("@position-try")}} at-rule
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- {{cssxref("inset-area")}}, {{cssxref("position-try-options")}}
- The {{cssxref("@position-try")}} at-rule
- {{cssxref("inset-area")}}
- {{cssxref("position-try-options")}}
- {{cssxref("@position-try")}} at-rule

Comment on lines +51 to +55
- Predefined option
- : Referred to as a `try-tactic` in the specification, these predefined values move the positioned element by taking its computed position and transforming it across a particular axis of the anchor. Possible values are:
- `flip-block`: Flips the element's position along the block axis so that it appears the same distance away from the anchor but on the opposite side of it. To put it another way, it mirrors the element's position across an inline axis drawn through the center of the anchor. As an example, if the positioned element started to overflow at the top of the anchor, this value would flip it to the bottom.
- `flip-inline`: Flips the element's position along the inline axis so that it appears the same distance away from the anchor but on the opposite side of it. To put it another way, it mirrors the element's position across a block axis drawn through the center of the anchor. As an example, if the positioned element started to overflow at the left of the anchor, this value would flip it to the right.
- `flip-start`: Mirrors the element's position across an axis drawn diagonally through the center of the anchor, passing through the point at the intersection of the block axis start and the inline axis start, and the point at the intersection of the block axis end and the inline axis end. As an example, if the positioned element started to overflow at the left of the anchor, this value would flip it to the top.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Predefined option
- : Referred to as a `try-tactic` in the specification, these predefined values move the positioned element by taking its computed position and transforming it across a particular axis of the anchor. Possible values are:
- `flip-block`: Flips the element's position along the block axis so that it appears the same distance away from the anchor but on the opposite side of it. To put it another way, it mirrors the element's position across an inline axis drawn through the center of the anchor. As an example, if the positioned element started to overflow at the top of the anchor, this value would flip it to the bottom.
- `flip-inline`: Flips the element's position along the inline axis so that it appears the same distance away from the anchor but on the opposite side of it. To put it another way, it mirrors the element's position across a block axis drawn through the center of the anchor. As an example, if the positioned element started to overflow at the left of the anchor, this value would flip it to the right.
- `flip-start`: Mirrors the element's position across an axis drawn diagonally through the center of the anchor, passing through the point at the intersection of the block axis start and the inline axis start, and the point at the intersection of the block axis end and the inline axis end. As an example, if the positioned element started to overflow at the left of the anchor, this value would flip it to the top.
- `<try-tactic>`
- : One of three predefined options that move the positioned element by taking its computed position and transforming it across a particular axis of the anchor, including:
- `flip-block`
- : Flips the element's position along the block axis.
- `flip-inline`:
- : Flips the element's position along the inline axis.
- `flip-start`
- : Flips both the inline and block axis values, swapping the `start` properties with each other, and the `end` properties with each other.

Then put the descriptions of each value in a ### try tactics section within the ## description section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs size/xl >1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants