You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom Properties and paint function arguments will give us most of the mechanisms available for CSS to feed data into a paint routine, but there's still one missing - custom resources.
For example, keyframes are passed into the animation subsystem via a specific @Keyframes resource dictionary, while fonts are configured using an @fontface dictionary.
A specific use-case for allowing custom resource dictionaries is replicating the paint server idea from SVG - it'd be really nice to be able to specify paint resources that can be incorporated into custom paint routines across the document in a manner analogous to the way that backgrounds can currently reference any paint server in the document.
A very rough V0 API sketch would be:
a way of programmatically defining a resource dictionary with a name
a way of programmatically inserting resources into the dictionary
a way of registering a custom paint dependency on a resource dictionary
a way of fetching resources from the resource dictionary into the custom painter
A major caveat that will need to be solved here is that we either need to make the paint routine re-run every time any value is inserted into the resource dictionary, or we'll need to be smarter about tracking runtime dependencies for resource dictionaries (e.g. the paint function might have an API to register an explicit dependency on a name in the resource dictionary too).
Once the parser API is up and running then it will be very natural to hook parser output up to resource population, so we might want to add declarative affordances for that too.
The text was updated successfully, but these errors were encountered:
Custom Properties and paint function arguments will give us most of the mechanisms available for CSS to feed data into a paint routine, but there's still one missing - custom resources.
For example, keyframes are passed into the animation subsystem via a specific @Keyframes resource dictionary, while fonts are configured using an @fontface dictionary.
A specific use-case for allowing custom resource dictionaries is replicating the paint server idea from SVG - it'd be really nice to be able to specify paint resources that can be incorporated into custom paint routines across the document in a manner analogous to the way that backgrounds can currently reference any paint server in the document.
A very rough V0 API sketch would be:
A major caveat that will need to be solved here is that we either need to make the paint routine re-run every time any value is inserted into the resource dictionary, or we'll need to be smarter about tracking runtime dependencies for resource dictionaries (e.g. the paint function might have an API to register an explicit dependency on a name in the resource dictionary too).
Once the parser API is up and running then it will be very natural to hook parser output up to resource population, so we might want to add declarative affordances for that too.
The text was updated successfully, but these errors were encountered: