philipjohnbasile commited on
Commit
9fcd564
Β·
verified Β·
1 Parent(s): 16ba26f

Upload design/design_canon.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. design/design_canon.py +2 -2
design/design_canon.py CHANGED
@@ -38,8 +38,8 @@ Output production-ready HTML+CSS with CSS custom properties for the OKLCH palett
38
  # ── the audit gate (verifies a design is elite; powers the constrain gate + the heal filter) ─────────
39
  _BANNED_COLOR = re.compile(r"#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b|\brgba?\(|\bhsla?\(")
40
  _SPACING_DECL = re.compile(r"(?:margin|padding|gap|row-gap|column-gap)[^:;{}]*:\s*([^;}]+)", re.I) # spacing rhythm only β€” NOT absolute positioning (top/left are functional placement, not the 8px grid)
41
- _PX = re.compile(r"(\d+(?:\.\d+)?)px")
42
- _FONT_PX = re.compile(r"font-size\s*:\s*(\d+(?:\.\d+)?)px", re.I)
43
  _SCALE = {12.0, 16.0, 20.0, 25.0, 31.0, 39.0, 49.0, 61.0} # 1.25 modular scale
44
 
45
  # COOKIE-CUTTER detector β€” the user's core want: bespoke, not framework-default. Technically-elite OKLCH can
 
38
  # ── the audit gate (verifies a design is elite; powers the constrain gate + the heal filter) ─────────
39
  _BANNED_COLOR = re.compile(r"#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b|\brgba?\(|\bhsla?\(")
40
  _SPACING_DECL = re.compile(r"(?:margin|padding|gap|row-gap|column-gap)[^:;{}]*:\s*([^;}]+)", re.I) # spacing rhythm only β€” NOT absolute positioning (top/left are functional placement, not the 8px grid)
41
+ _PX = re.compile(r"(\d{1,7}(?:\.\d{1,4})?)px") # bounded: stops ReDoS O(nΒ²) backtracking on huge digit runs
42
+ _FONT_PX = re.compile(r"font-size\s*:\s*(\d{1,7}(?:\.\d{1,4})?)px", re.I)
43
  _SCALE = {12.0, 16.0, 20.0, 25.0, 31.0, 39.0, 49.0, 61.0} # 1.25 modular scale
44
 
45
  # COOKIE-CUTTER detector β€” the user's core want: bespoke, not framework-default. Technically-elite OKLCH can