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
Currently, there's no identifer for third-party tools like Pendo to detect whether the app is in light or dark mode. This PR adds a theme identifier so Pendo can apply appropriate styling. Third-party tools (like Pendo) should be able to use this as selector: body[data-theme="dark"] or body[data-theme="light"]
Important
We're using a custom data-theme attribute instead of a CSS class because it's the proper way to store application state according to HTML5 standards. CSS classes are meant for styling, and this approach avoids conflicts with our existing CSS while giving Pendo a reliable selector to detect the current theme.
Changes 🔄
Set custom data attribute on document body for third-party tools (like Pendo) to detect application theme
Scope 🚢
All customers
Target release date 🗓️
N/A
Preview 📷
How to test 🧪
Verification steps
Check attribute is set correctly:
Open DevTools -> Elements tab
Inspect <body> element
Verify data-theme="light" or data-theme="dark" is present (based on the current theme)
Test the selector:
Open DevTools -> Console and run: document.querySelector('body[data-theme="dark"]') (when in dark mode, should return element Otherwise null)
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
I have read and considered all applicable items listed above.
As an Author, before moving this PR from Draft to Open, I confirmed ✅
Great job, team! I have just one concern: in Pendo, it states that a CSS selector is required, and there’s no guidance on using data-theme as an alternative. I’ve shared the PR link with Susana so she can confirm whether it can be used for the Pendo use case.
Great job, team! I have just one concern: in Pendo, it states that a CSS selector is required, and there’s no guidance on using data-theme as an alternative. I’ve shared the PR link with Susana so she can confirm whether it can be used for the Pendo use case.
Thanks @davyd-akamai! We may/should be able to use these custom attributes, which are generally more reliable in cases like this. Since HTML attribute selectors are valid CSS selectors, Pendo should support targeting them using selectors such as body[data-theme="dark"] or [data-theme="dark"] (potentially with some configuration in the Pendo dashboard if needed).
Pendo also has related docs that seems to support this approach:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnalyticsRelating to Pendo or Adobe AnalyticsApprovedMultiple approvals and ready to merge!
5 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description 📝
Currently, there's no identifer for third-party tools like Pendo to detect whether the app is in
lightordarkmode. This PR adds a theme identifier so Pendo can apply appropriate styling. Third-party tools (like Pendo) should be able to use this as selector:body[data-theme="dark"]orbody[data-theme="light"]Important
We're using a custom
data-themeattribute instead of a CSS class because it's the proper way to store application state according to HTML5 standards. CSS classes are meant for styling, and this approach avoids conflicts with our existing CSS while giving Pendo a reliable selector to detect the current theme.Changes 🔄
Scope 🚢
Target release date 🗓️
N/A
Preview 📷
How to test 🧪
Verification steps
<body>elementdata-theme="light"ordata-theme="dark"is present (based on the current theme)document.querySelector('body[data-theme="dark"]')(when in dark mode, should return element Otherwisenull)Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅