Class CSSContainerRule
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The CSSContainerRule interface represents a single CSS @container rule.
[Value("CSSContainerRule")]
public class CSSContainerRule : CSSConditionRule
- Inheritance
-
CSSContainerRule
- Inherited Members
Remarks
An object of this type can be used to get the query conditions for the @container, along with the container name if one is defined.
Note that the container name and query together define the "condition text", which can be obtained using ConditionText.
-CSS container-name, container-type, and container shorthand properties
-CSS containment module
-Container queries
-Using container size and style queries
Constructors
CSSContainerRule()
public CSSContainerRule()
Properties
ContainerName
The read-only containerName property of the CSSContainerRule interface represents the container name of the associated CSS {{cssxref("@container")}} at-rule.
[Value("containerName")]
public string ContainerName { get; }
Property Value
- string
A string that contains the
container-nameof the {{cssxref("@container")}} associated with this CSSContainerRule.
If the_containeris not named, the function returns the empty string ("").
Remarks
For example, the value of containerName for the @container below is sidebar:
-CSS container shorthand property
-CSS containment module
-Container queries
-Using container size and style queries
ContainerQuery
The read-only containerQuery property of the CSSContainerRule interface returns a string representing the container conditions that are evaluated when the container changes size in order to determine if the styles in the associated {{cssxref("@container")}} are applied.
[Value("containerQuery")]
public string ContainerQuery { get; }
Property Value
- string
A string containing the container query.Note that the value may not be identical to the original string, as normalizations such as removing whitespace may happen.
Remarks
For example, the value of containerQuery for the @container below is (width >= 700px):
-CSS containment module
-Container queries
-Using container size and style queries