gabotorresruiz opened a new pull request, #34273: URL: https://github.com/apache/superset/pull/34273
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> This PR enhances Superset's embedded dashboard theming system by adding support for dynamic theme configuration. Now Embedded SDK uses the ThemeController and follows the same logic and rules for themes and permissions Now we can pass something like this: ``` { theme_default: { token: { colorPrimary: '#0066cc', colorSuccess: '#00a86b', colorWarning: '#ff9900', colorError: '#d32f2f', colorInfo: '#1976d2', colorTextSecondary: '#232323ff', fontFamily: "'Roboto', sans-serif", }, }, theme_dark: { token: { colorPrimary: '#4d9aff', colorSuccess: '#4caf50', colorWarning: '#ffb74d', colorError: '#f44336', colorInfo: '#2196f3', colorTextBase: '#ffffff', colorBgBase: '#121212', colorBgContainer: '#1e1e1e', colorBgLayout: '#121212', colorBorder: '#333333', colorTextSecondary: '#b3b3b3', colorTextTertiary: '#666666', colorSplit: '#333333', fontFamily: "'Roboto', sans-serif", }, algorithm: 'dark', }, theme_settings: { enforced: true, // Enforces the Default theme allowSwitching: false, // Themes cannot be switch allowOSPreference: false, // Ignore OS preference }, } ``` And those themes and setting will apply to the embedded dashboard ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> 1. Create an application that embeds superset using sdk.(An example can be found [here](https://github.com/msyavuz/theme-embedding-poc)) 2. Link embedded-sdk to your project dependencies: i. Run npm link inside superset-embedded-sdk directory ii. Run npm link @superset-ui/embedded-sdk inside your project. 3. Embed a dashboard with the sdk. 4. Run setThemeConfig on the embedded dashboard with your theme configuration. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
