You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by di...@apache.org on 2024/07/31 13:19:54 UTC
(superset) branch geido/refactor/antd5-slider updated: refactor(Slider): Use SupersetTheme for margins
This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch geido/refactor/antd5-slider
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/geido/refactor/antd5-slider by this push:
new 96db42a0b2 refactor(Slider): Use SupersetTheme for margins
96db42a0b2 is described below
commit 96db42a0b2200a493db0bb66ebdf6f673abffa22
Author: Diego Pucci <di...@gmail.com>
AuthorDate: Wed Jul 31 16:19:42 2024 +0300
refactor(Slider): Use SupersetTheme for margins
---
superset-frontend/src/components/Slider/index.tsx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/src/components/Slider/index.tsx b/superset-frontend/src/components/Slider/index.tsx
index a3fb066146..6eba7800ba 100644
--- a/superset-frontend/src/components/Slider/index.tsx
+++ b/superset-frontend/src/components/Slider/index.tsx
@@ -18,9 +18,17 @@
*/
import { SliderSingleProps, SliderRangeProps } from 'antd-v5/lib/slider';
import { Slider as AntdSlider } from 'antd-v5';
+import { SupersetTheme, css } from '@superset-ui/core';
export type { SliderSingleProps, SliderRangeProps };
export default function Slider(props: SliderSingleProps | SliderRangeProps) {
- return <AntdSlider {...props} css={{ margin: '10px 0px 10px' }} />;
+ return (
+ <AntdSlider
+ {...props}
+ css={(theme: SupersetTheme) => css`
+ margin: ${theme.gridUnit * 2 + 2}px 0 0 ${theme.gridUnit * 2 + 2}px;
+ `}
+ />
+ );
}