If I understand you correctly, this means that you are going to inject code into the HTML of the iframe? Given that this is not your HTML to control, that means you are adding it to the HTML element from the all.js include? Or will it be done on iframe onLoad event handler?
all.js will perform all of the orchestration, so apps will not need to configure anything to get theming working. That does mean that we will inject attributes onto the element as well as inject style sheets into the .
These are necessary to be able to trigger CSS selectors (activate a theme) and allow apps to read and respond to the theme state accordingly. For example, if you have brand-specific colours that need to be changed between light/dark modes.
So we need to wait for that to load and manipulate the DOM before the data- attribute is set
I’m not sure if I understand this point, but you shouldn’t need to manipulate the DOM relative to the timing of the data attr. What are the other scenarios where you need to manipulate the DOM? If you can share examples we’ll look into it.
how will you handle iframe that do not have
We have not come across this use case yet, what kind of scenarios would an app not have a element?
how will it be done in custom ui? Can we get some sample code to demonstrate how you expect a react app to behave? (Since we do have custom components that will have to adapt as well).
Both Connect & Forge Custom UI will take a similar approach, they both handle the theme configuration behind the scenes when the app loads. So similar to the above, you’ll see stylesheets containing theme files mounted to the page and attributes attached to the HTML element.
Usage in both Connect & Forge Custom UI will follow the same pattern shown in our docs: https://atlassian.design/components/tokens/examples#button
how will you handle redirects?
Redirects are not a scenario we’ve come across yet in our early explorations. Could you share some context on this for us to look into?
@stephenmok any chance of getting a pre-release/beta version of the new Atlassian Figma Design Tokens Plugin?
Yeah, we’re planning to share that very soon, within the next month We’ll update this thread when we have more information.