This is an automated email from the ASF dual-hosted git repository.
lyndsi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new ba65f66897 fix: Change downloadAsImage to use Superset theme (#22011)
ba65f66897 is described below
commit ba65f668972666dcd32602b718c858622c87dab6
Author: Lyndsi Kay Williams <[email protected]>
AuthorDate: Wed Nov 2 21:24:10 2022 -0500
fix: Change downloadAsImage to use Superset theme (#22011)
---
superset-frontend/src/utils/downloadAsImage.ts | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/superset-frontend/src/utils/downloadAsImage.ts
b/superset-frontend/src/utils/downloadAsImage.ts
index 145fb86508..de74543646 100644
--- a/superset-frontend/src/utils/downloadAsImage.ts
+++ b/superset-frontend/src/utils/downloadAsImage.ts
@@ -19,15 +19,9 @@
import { SyntheticEvent } from 'react';
import domToImage from 'dom-to-image-more';
import kebabCase from 'lodash/kebabCase';
-import { t } from '@superset-ui/core';
+import { t, supersetTheme } from '@superset-ui/core';
import { addWarningToast } from 'src/components/MessageToasts/actions';
-/**
- * @remark
- * same as
https://github.com/apache/superset/blob/c53bc4ddf9808a8bb6916bbe3cb31935d33a2420/superset-frontend/src/assets/stylesheets/less/variables.less#L34
- */
-const GRAY_BACKGROUND_COLOR = '#F5F5F5';
-
/**
* generate a consistent file stem from a description and date
*
@@ -77,7 +71,7 @@ export default function downloadAsImage(
return domToImage
.toJpeg(elementToPrint, {
quality: 0.95,
- bgcolor: GRAY_BACKGROUND_COLOR,
+ bgcolor: supersetTheme.colors.grayscale.light4,
filter,
})
.then(dataUrl => {