fast icon indicating copy to clipboard operation
fast copied to clipboard

feat: add DesignToken root that can be used in SSR

Open nicholasrice opened this issue 2 years ago • 0 comments

🙋 Feature Request

DesignToken should support registration of a root that can be used in SSR environments to store and emit CSS custom properties for a compilation context.

🤔 Expected Behavior

😯 Current Behavior

Today, the roots that can be registered for DesignToken default CSS custom property emission are any FASTElement instance or a document, with the default being the document. When streaming SSR results, this CSS custom property data can get lost; SSR compiles an HTML template with custom elements and can't know where CSS custom properties should be emitted for non-FAST Element targets.

💁 Possible Solution

By opening up root registration the PropertyTarget type (currently an internal interface used by DesignToken), SSR compatible DesignToken root types can be created that store CSS and allow stringifying those values.

🔦 Context

💻 Examples

nicholasrice avatar Aug 09 '22 20:08 nicholasrice