From d635c2a9aba04f3154268368a4544fea6c2a26ad Mon Sep 17 00:00:00 2001 From: Enzo Martellucci Date: Wed, 7 May 2025 20:52:18 +0200 Subject: [PATCH] fix: replace invalid theme tokens --- .../src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx | 8 ++++---- .../src/BigNumber/BigNumberViz.tsx | 10 +++++----- .../filters/components/Select/SelectFilterPlugin.tsx | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx index 53e33ada82c..7d70e5bcb85 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx @@ -38,11 +38,11 @@ import { useOverflowDetection } from './useOverflowDetection'; const MetricNameText = styled.div<{ metricNameFontSize?: number }>` ${({ theme, metricNameFontSize }) => ` - font-family: ${theme.typography.families.sansSerif}; - font-weight: ${theme.typography.weights.normal}; - font-size: ${metricNameFontSize || theme.typography.sizes.s * 2}px; + font-family: ${theme.fontFamily}; + font-weight: ${theme.fontWeightNormal}; + font-size: ${metricNameFontSize || theme.fontSizeSM * 2}px; text-align: center; - margin-bottom: ${theme.gridUnit * 3}px; + margin-bottom: ${theme.sizeUnit * 3}px; `} `; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx index d6f8f364d8e..3fbb302b872 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx @@ -396,7 +396,7 @@ class BigNumberVis extends PureComponent { } getTotalElementsHeight() { - const marginPerElement = 8; // theme.gridUnit = 4, so margin-bottom = 8px + const marginPerElement = 8; // theme.sizeUnit = 4, so margin-bottom = 8px const refs = [ this.metricNameRef, @@ -546,12 +546,12 @@ export default styled(BigNumberVis)` .kicker { line-height: 1em; - margin-bottom: ${theme.gridUnit * 2}px; + margin-bottom: ${theme.sizeUnit * 2}px; } .metric-name { line-height: 1em; - margin-bottom: ${theme.gridUnit * 2}px; + margin-bottom: ${theme.sizeUnit * 2}px; } .header-line { @@ -567,12 +567,12 @@ export default styled(BigNumberVis)` .subheader-line { line-height: 1em; - margin-bottom: ${theme.gridUnit * 2}px; + margin-bottom: ${theme.sizeUnit * 2}px; } .subtitle-line { line-height: 1em; - margin-bottom: ${theme.gridUnit * 2}px; + margin-bottom: ${theme.sizeUnit * 2}px; } &.is-fallback-value { diff --git a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx index c59af32625c..90c15333932 100644 --- a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx +++ b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx @@ -95,8 +95,7 @@ const StyledSpace = styled(Space)<{ &.antd5-space { .antd5-space-item { - width: ${({ $inverseSelection }) => - !$inverseSelection ? '100%' : 'auto'}; + width: ${({ inverseSelection }) => (!inverseSelection ? '100%' : 'auto')}; } } `;