Skip to content

Conversation

asamuzaK
Copy link
Contributor

@asamuzaK asamuzaK commented Sep 8, 2025

Fixes #242
Rebased #243

Spec: https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface

  • Breaking change: the functionality provided by CSSStyleDeclaration is now provided by CSSStyleProperties, i.e. use new CSSStyleProperties() to create an instance.
  • Breaking change: the arguments to new CSSStyleProperties() are different from the arguments to new CSSStyleDeclaration().
    • The first argument is a Window.
    • The second argument is an options object.
      • The on change callback previously received as the first argument should be included in the options object using onChange key.
    const node = document.createElement("div");
    const callback = cssText => {
      console.log(cssText);
    };
    const style = new CSSStyleProperties(window, {
      onChange: callback
    });
  • Switched main entry point from ./lib/CSSStyleDeclaration.js to ./lib/index.js.
    • Exporting 3 files from index.js.
      • CSSStyleDeclaration.js
      • CSSStypeProperties.js
      • propertyList.js
        • List of supported properties and their definitions.
  • Updated dependencies and devDependencies.

@asamuzaK asamuzaK marked this pull request as draft September 8, 2025 14:04
@asamuzaK asamuzaK force-pushed the style2 branch 5 times, most recently from 3ae525e to ab291f8 Compare September 9, 2025 21:17
@asamuzaK asamuzaK force-pushed the style2 branch 4 times, most recently from 486f6a9 to 8413f47 Compare September 13, 2025 01:45
@asamuzaK asamuzaK force-pushed the style2 branch 2 times, most recently from ecd06b0 to 1a3321e Compare September 14, 2025 05:11
@asamuzaK asamuzaK marked this pull request as ready for review September 14, 2025 06:56
@asamuzaK asamuzaK requested a review from domenic September 14, 2025 06:56
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.

Prepare and export CSSStyleProperties
2 participants