-
-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
This works when border is set to a full border property like 1px solid black, but not a keyword like inherit.
Code
import { CSSStyleDeclaration } from "cssstyle"
const style = new CSSStyleDeclaration();
style.border = "inherit";
style.borderWidth = "unset";Exception
node_modules/.pnpm/cssstyle@6.2.0/node_modules/cssstyle/lib/normalize.js:290
shorthandObj[key] = parsedValue;
^
TypeError: Cannot create property 'border-width' on string 'inherit'
at replaceBorderShorthandValue (node_modules/.pnpm/cssstyle@6.2.0/node_modules/cssstyle/lib/normalize.js:290:29)
at prepareBorderArrayValue (node_modules/.pnpm/cssstyle@6.2.0/node_modules/cssstyle/lib/normalize.js:707:31)
at prepareBorderProperties (node_modules/.pnpm/cssstyle@6.2.0/node_modules/cssstyle/lib/normalize.js:935:5)
at CSSStyleDeclaration._borderSetter (node_modules/.pnpm/cssstyle@6.2.0/node_modules/cssstyle/lib/CSSStyleDeclaration.js:449:30)
at CSSStyleDeclaration.set (node_modules/.pnpm/cssstyle@6.2.0/node_modules/cssstyle/lib/properties/borderWidth.js:29:14)
Node.js v22.18.0Seems related to #247. Thanks very much!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels