EnxDev commented on code in PR #38604:
URL: https://github.com/apache/superset/pull/38604#discussion_r2958953932


##########
superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx:
##########
@@ -30,6 +31,59 @@ import type {
   OnClickHandler,
 } from './types';
 
+/**
+ * Secondary Button Theming
+ *
+ * Ant Design's "filled" variant (used for secondary buttons) has no 
component-level
+ * tokens for customization. To enable full theming of secondary buttons, we 
use
+ * Superset-specific tokens (buttonSecondary*) with fallbacks to Ant Design's
+ * colorPrimary* derived tokens.
+ *
+ * Implementation approach (follows PR #38679 pattern for label tokens):
+ * - Default state: Applied via inline `style` prop (higher specificity than 
CSS classes)
+ * - Hover/Active states: Applied via `css` prop with !important 
(pseudo-selectors
+ *   cannot be applied via inline styles)
+ *
+ * Available tokens (all optional, with sensible fallbacks):
+ * - buttonSecondaryColor: Text color (fallback: colorPrimary)
+ * - buttonSecondaryBg: Background color (fallback: colorPrimaryBg)
+ * - buttonSecondaryBorderColor: Border color (fallback: transparent)
+ * - buttonSecondaryHoverColor: Hover text color (fallback: colorPrimary)
+ * - buttonSecondaryHoverBg: Hover background (fallback: colorPrimaryBgHover)
+ * - buttonSecondaryHoverBorderColor: Hover border (fallback: transparent)
+ * - buttonSecondaryActiveColor: Active/pressed text color (fallback: 
colorPrimary)
+ * - buttonSecondaryActiveBg: Active/pressed background (fallback: 
colorPrimaryBorder)
+ * - buttonSecondaryActiveBorderColor: Active/pressed border (fallback: 
transparent)
+ */
+
+/**
+ * Generates inline styles for secondary buttons (default state).
+ * Inline styles have higher specificity than CSS classes, so no !important 
needed.
+ */
+export const getSecondaryButtonStyle = (theme: SupersetTheme) => ({
+  color: theme.buttonSecondaryColor ?? theme.colorPrimary,
+  backgroundColor: theme.buttonSecondaryBg ?? theme.colorPrimaryBg,
+  borderColor: theme.buttonSecondaryBorderColor ?? 'transparent',
+});

Review Comment:
   Just to confirm, are we assuming that passing an empty token here is 
acceptable?



-- 
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]

Reply via email to