Skip to content

Commit

Permalink
Update syntax example and Values to match
Browse files Browse the repository at this point in the history
  • Loading branch information
wbamberg committed Sep 15, 2023
1 parent d5c04f4 commit 7ae1fe3
Showing 1 changed file with 34 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ For example:
```css
/* Without a fallback */
/* var( <custom-property-name> ) */
var(--custom-prop)
/* With fallback */
/* With an empty fallback */
/* var( <custom-property-name> , ) */
var(--custom-prop,)
/* With a fallback value */
/* var( <custom-property-name> , <declaration-value> ) */
var(--custom-prop, initial)
var(--custom-prop, #FF0000)
Expand All @@ -118,12 +117,10 @@ var(--custom-prop, var(--default-value, red))
List the parameters that the function can accept as a {{htmlelement("dl")}}. List them in the order that they appear in the _Formal syntax_ section. Indicate if a parameter is optional using the `optional_inline` badge.
Include one term and definition for each parameter.

- `<parameter-name-1>`
- : Include a description of the parameter, its data type, and its default value if any
- `<parameter-name-2>`
- : Include a description of the parameter, its data type, and its default value if any
- `<parameter-name-3>` {{optional_inline}}
- : Include a description of the parameter, its data type, and its default value if any
- `<custom-property-name>`
- : Include a description of the parameter, its data type, and its default value if any.
- `<declaration-value>` {{optional_inline}}
- : Include a description of the parameter, its data type, and its default value if any.

### Return value

Expand Down Expand Up @@ -151,6 +148,34 @@ Each example must have an H3 heading (`###`) naming the example. The heading sho

See our guide on how to add [code examples](/en-US/docs/MDN/Writing_guidelines/Page_structures/Code_examples) for more information.

> **Note:** Sometimes you will want to link to examples given on another page.
>
> **Scenario 1:** If you have some examples on this page and some more examples on another page:
>
> Include an H3 heading (`###`) for each example on this page and then a final H3 heading (`###`) with the text "More examples", under which you can link to the examples on other pages. For example:
>
> ```md
> ## Examples
>
> ### Using the polygon() function
>
> Example of polygon()
>
> ### More examples
>
> Links to more examples on other pages
> ```
>
> **Scenario 2:** If you _only_ have examples on another page and none on this page:
>
> Don't add any H3 headings; just add the links directly under the H2 heading "Examples". For example:
>
> ```md
> ## Examples
>
> For examples of this function, see [the page on basic-shape](https://example.org).
> ```
## Accessibility concerns
This is an optional section. You can include any warnings here for accessibility concerns that developers should be aware of while using this function. You can also include workarounds for these accessibility concerns if there are any.
Expand Down

0 comments on commit 7ae1fe3

Please sign in to comment.