Skip to content

Support register custom propery #1686

Open
@idoros

Description

@idoros

@property at-rule registers a custom property for runtime type checking, setting default value and configuring inherit behavior. Stylable can improve DX of custom properties by keeping track of the registration of a property and providing static language services around them:

  • completions for valid syntax types
    • multipliers for lists of values
    • combinators for complex syntax combinations
    • might be interesting to offer built in shorthand types ('<--background>')
  • hover information to show the type, initial-value and inherit behavior
  • completion for valid places (can suggest relevant properties inside a var() value or the entire var(--color) where appropriate)
  • diagnostics
    • mismatch property in a position that can be identified to have a mismatched type
    • make sure initial-value is valid for the registered type
  • Not sure if needed, but Stylable can offer fallback registration through CSS.registerProperty

Edit:
In addition transforming @property rule should:

  • namespace the property (support global)
  • export the property even when not used in any declaration

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreProcessing and transforming logicfeatureNew syntax feature or behaviorlanguage-serviceCompletions, highlights, definitions and more LSP capabilities

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions