container-name-pattern
Specify a pattern for container names.
@container foo (width > 400px) {}/** ↑ * The pattern of this */Use this rule to enforce a convention. For example, require kebab-case names for consistency with the specifications’ examples.
This rule supports 2 message arguments: the container name and the configured pattern.
Options
Section titled “Options”string
Section titled “string”Specify a regex string not surrounded with "/".
Given:
{ "container-name-pattern": "foo-.+"}The following patterns are considered problems:
@container foo {}a { container-name: bar; }a { container: baz / inline-size; }The following patterns are not considered problems:
@container foo-bar {}a { container-name: foo-bar; }a { container: foo-baz / inline-size; }