From e5ee236f72b3adcdef885ca753eac04aecc9cb74 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Mon, 23 Dec 2024 16:28:51 +0800 Subject: [PATCH 1/2] Add & move Formal syntax section for css at-rule --- files/en-us/web/css/@charset/index.md | 10 ++++------ files/en-us/web/css/@color-profile/index.md | 8 ++++---- files/en-us/web/css/@container/index.md | 4 ++++ files/en-us/web/css/@media/index.md | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/files/en-us/web/css/@charset/index.md b/files/en-us/web/css/@charset/index.md index 8f982301b260633..8ea97eb15dea47a 100644 --- a/files/en-us/web/css/@charset/index.md +++ b/files/en-us/web/css/@charset/index.md @@ -26,15 +26,13 @@ As there are several ways to define the character encoding of a style sheet, the @charset "iso-8859-15"; ``` -### Formal syntax - -```plain -@charset ""; -``` - - _charset_ - : A {{cssxref("<string>")}} denoting the character encoding to be used. It must be the name of a web-safe character encoding defined in the [IANA-registry](https://www.iana.org/assignments/character-sets/character-sets.xhtml), and must be double-quoted, following exactly one space character (U+0020), and immediately terminated with a semicolon. If several names are associated with an encoding, only the one marked with _preferred_ must be used. +## Formal syntax + +{{csssyntax}} + ## Examples ### Valid and invalid charset declarations diff --git a/files/en-us/web/css/@color-profile/index.md b/files/en-us/web/css/@color-profile/index.md index df869b201d01c36..2ccdb69c512c912 100644 --- a/files/en-us/web/css/@color-profile/index.md +++ b/files/en-us/web/css/@color-profile/index.md @@ -36,6 +36,10 @@ The **`@color-profile`** [CSS](/en-US/docs/Web/CSS) [at-rule](/en-US/docs/Web/CS - `saturation` - : This option was created to preserve the relative saturation (chroma) of the original, and to keep solid colors pure. However, it experienced interoperability problems like the perceptual intent. +## Formal syntax + +{{csssyntax}} + ## Examples This example is from the specification and demonstrates using offset printing to ISO 12647-2:2004 using the CGATS/SWOP TR005 2007 characterization data on grade 5 paper with an ink limit of 300% Total Area Coverage, and medium gray component replacement (GCR). @@ -51,10 +55,6 @@ The `src` descriptor specifies the URL to retrieve the color-profile information } ``` -## Formal syntax - -{{csssyntax}} - ## Specifications {{Specifications}} diff --git a/files/en-us/web/css/@container/index.md b/files/en-us/web/css/@container/index.md index 0bc5f0c101b4862..a36f9836ecc9072 100644 --- a/files/en-us/web/css/@container/index.md +++ b/files/en-us/web/css/@container/index.md @@ -148,6 +148,10 @@ The following descriptors can be used within the container condition: - `width` - : The width of the container expressed as a {{cssxref("length")}} value. +## Formal syntax + +{{csssyntax}} + ## Examples ### Setting styles based on a container's size diff --git a/files/en-us/web/css/@media/index.md b/files/en-us/web/css/@media/index.md index 96d82292f6f65d4..26db828a46c7c42 100644 --- a/files/en-us/web/css/@media/index.md +++ b/files/en-us/web/css/@media/index.md @@ -171,6 +171,10 @@ Some media queries have corresponding [user agent client hints](/en-US/docs/Web/ These are HTTP headers that request content that is pre-optimized for the particular media requirement. They include {{HTTPHeader("Sec-CH-Prefers-Color-Scheme")}} and {{HTTPHeader("Sec-CH-Prefers-Reduced-Motion")}}. +## Formal syntax + +{{csssyntax}} + ## Accessibility To best accommodate people who adjust a site's text size, use [`em`](/en-US/docs/Web/CSS/CSS_Values_and_Units#numeric_data_types)s when you need a {{cssxref("<length>")}} for your [media queries](/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries). @@ -186,10 +190,6 @@ Because media queries provide insights into the capabilities—and by extension, Because of this potential, a browser may opt to fudge the returned values in some manner in order to prevent them from being used to precisely identify a computer. A browser might also offer additional measures in this area; for example, if Firefox's "Resist Fingerprinting" setting is enabled, many media queries report default values rather than values representing the actual device state. -## Formal syntax - -{{csssyntax}} - ## Examples ### Testing for print and screen media types From bc8b1c84cfaeee8b1747209ee2c79bea2c683aa1 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Mon, 23 Dec 2024 16:35:01 +0800 Subject: [PATCH 2/2] Update index.md --- files/en-us/web/css/@charset/index.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/files/en-us/web/css/@charset/index.md b/files/en-us/web/css/@charset/index.md index 8ea97eb15dea47a..8f982301b260633 100644 --- a/files/en-us/web/css/@charset/index.md +++ b/files/en-us/web/css/@charset/index.md @@ -26,12 +26,14 @@ As there are several ways to define the character encoding of a style sheet, the @charset "iso-8859-15"; ``` -- _charset_ - - : A {{cssxref("<string>")}} denoting the character encoding to be used. It must be the name of a web-safe character encoding defined in the [IANA-registry](https://www.iana.org/assignments/character-sets/character-sets.xhtml), and must be double-quoted, following exactly one space character (U+0020), and immediately terminated with a semicolon. If several names are associated with an encoding, only the one marked with _preferred_ must be used. +### Formal syntax -## Formal syntax +```plain +@charset ""; +``` -{{csssyntax}} +- _charset_ + - : A {{cssxref("<string>")}} denoting the character encoding to be used. It must be the name of a web-safe character encoding defined in the [IANA-registry](https://www.iana.org/assignments/character-sets/character-sets.xhtml), and must be double-quoted, following exactly one space character (U+0020), and immediately terminated with a semicolon. If several names are associated with an encoding, only the one marked with _preferred_ must be used. ## Examples