Skip to content

feat: add property_basename string helper - #343

Merged
bartveneman merged 4 commits into
mainfrom
claude/property-basename
Nov 8, 2026
Merged

bartveneman merged 4 commits into
mainfrom
claude/property-basename

Conversation

@bartveneman

@bartveneman bartveneman commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds the string helper property_basename(), exported from the root and /string-utils. It returns a normalized property name: browser hack prefix (*, _, #, @, lone -) and vendor prefix removed, lowercased. Custom properties (--Foo) keep their case.
    • property_basename('*Color') → color, property_basename('-WEBKIT-Transform') → transform
  • Helper only, per review: no new CSSNode property, no parse-time work and no arena change. Use it on decl.property.

Test plan

  • property_basename unit tests (hacks, vendor prefixes, casing, custom properties, empty input)
  • pnpm run test --run, lint, check, knip

🤖 Generated with Claude Code

https://claude.ai/code/session_017tYcgRqrqoamtPUAnQDJ8w

basename (declarations, media features, @supports declarations) is the
property with browser hack and vendor prefix removed, lowercased unless it
is a custom property. property_basename() is exported as a string helper.
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Package Size Increase

📦 Package 📏 Base Size 📏 Source Size 📈 Size Change
@projectwallace/css-parser 47.3 kB 47.8 kB +461 B

@pkg-pr-new

pkg-pr-new Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@projectwallace/css-parser@bf930e1

commit: bf930e1

@bartveneman bartveneman changed the title feat: add basename and property_basename feat: add property_basename string helper Nov 8, 2026
@bartveneman
bartveneman merged commit a82a673 into main Nov 8, 2026
17 checks passed
@bartveneman
bartveneman deleted the claude/property-basename branch November 8, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants