WICG / canvas-formatted-text

Other
82 stars 17 forks source link

Apply styles via 'class' or stylesheet? #34

Closed travisleithead closed 2 years ago

travisleithead commented 3 years ago

(This is internal Microsoft feedback from a review of the spec by resident expert @petercon. Re-posting here with permission.)


Might there be any scenarios for setting text styling from a stylesheet using class (or any other potentially relevant selectors)?

travisleithead commented 2 years ago

Per PR https://github.com/WICG/canvas-formatted-text/pull/39, styles can be grouped into an object and applied per text run or for all text runs. However, no "cascading" or selector-based logic is in place. It seems potentially useful to be able to merge two or more separate groups of properties together, but I want to avoid adding that complexity until/unless there's a string use case for it, as workarounds to manually merge properties together into new groups is totally possible.

travisleithead commented 2 years ago

Hoping FormattedTextStyle can fit the bill for most use cases.