Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Web
#css
#variable
#custom-property
#frontend

CSS Custom Property (Variable)

Validates CSS custom property (variable) names starting with double dashes (--).

✓ CSS linter input validation✓ Design system property parser✓ Theme engine key validator
/
/
Safe
Test String
4 matches
--— '-' — literal character
--— '-' — literal character
[…]+Character class […]— Matches any single character listed in this set — repeated one or more times (greedy) · + — one or more times (greedy)
a-za-z— a-z — range from 'a' to 'z'
A-ZA-Z— A-Z — range from 'A' to 'Z'
0-90-9— 0-9 — range from '0' to '9'
__— '_' — literal character
--— '-' — literal character
Pattern: 16 charsInput: 57 chars
100% client-side · private

✓ Valid Examples

  • --primary-color
  • --bg-500
  • --header_height
  • --font-size-base

✗ Invalid Examples

  • -primary-color
  • primary-color
  • $primary-color
  • --

Usage & Integration

Validate CSS Custom Property (Variable) natively in your backend or frontend without copying regex strings.

Node / Edge

import { validate } from '@regexto/validators';

validate('css-variable', '...');

Python

from regexto_validators import validate

validate("css-variable", "...")

Go

import "github.com/regex-to/validators-go"

valid, err := validators.Validate("css-variable", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('css-variable', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("css-variable", "...").unwrap();