Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foundations for CSS OM #165

Merged
merged 14 commits into from
May 2, 2022
Merged

Foundations for CSS OM #165

merged 14 commits into from
May 2, 2022

Conversation

devongovett
Copy link
Member

@devongovett devongovett commented Apr 27, 2022

Part of #5, #10.

This PR implements the foundations for supporting the CSS OM API. In particular, it provides metadata and functions for properties to convert between shorthand and longhand representations, as well as deal with logical property groups. It also implements get, set and remove methods for DeclarationBlock, which correspond with the getPropertyValue/getPropertyPriority, setProperty, and removeProperty methods of CSSStyleDeclaration. This allows retrieving any shorthand or longhand property no matter what declarations were actually written, as well as setting such properties.

The Shorthand trait is added to expose metadata about shorthand properties such as the list of longhands it includes, as well as retrieve and set longhands, or construct the shorthand from a list of longhand declarations. Most shorthands implement this via the define_shorthand or define_list_shorthand macros, which wrap around a struct definition.

cc. @lucacasonato this might help you.

To do

  • More tests
  • Ensure all shorthands are implemented
    • Grid
    • Mask border
  • Improve docs

@devongovett devongovett marked this pull request as ready for review May 2, 2022 19:20
@devongovett devongovett merged commit 1b947b4 into master May 2, 2022
@devongovett devongovett deleted the cssom2 branch May 2, 2022 19:21
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.

None yet

1 participant