Skip to content

Variable: SINGLE_CLASS ​

ts
const SINGLE_CLASS: Regex<"^\\.(?<class>[A-Za-z_][\\w-]*)$", {
  flags: "u";
  names: {
     class: string;
  };
}>;

Defined in: packages/regex/src/tiers/cssdoc-local.ts:48

Single CSS Class Selector Pattern Matches a selector that is exactly one class (no other selectors). Used as a filter candidate for base class inference.

Example ​

ts
SINGLE_CLASS.test(".button") // true
SINGLE_CLASS.test(".button.active") // false
SINGLE_CLASS.test("button") // false

Released under the MIT License