Skip to content

Commit

Permalink
Merge pull request #104 from thoughtspot/SCAL-228904
Browse files Browse the repository at this point in the history
SCAL-228904 add customCSS passed from ts-embed-sdk
  • Loading branch information
UtkarshRai12 authored Feb 11, 2025
2 parents 88536aa + ab02739 commit 502e476
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thoughtspot/ts-chart-sdk",
"private": false,
"version": "1.2.3",
"version": "1.2.4",
"module": "lib/index",
"main": "lib/index",
"types": "lib/index",
Expand Down
27 changes: 27 additions & 0 deletions src/types/common.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,33 @@ export type ChartSdkDateFormatsConfig = {
export interface AppConfig {
styleConfig?: ChartSdkCustomStylingConfig;
dateFormatsConfig?: ChartSdkDateFormatsConfig;
/**
* these represent the custom css styles passed in the ts-embed-sdk (customization.style) in init event call. This mainly includes the customCssUrl, customCssVariables and rules_UNSTABLE.
* @type {Record<string, string | number>}
* @example
* {
customCSSUrl: "https://cdn.jsdelivr.net/gh/thoughtspot/custom-css-demo/css-variables.css",
// direct overrides declared within the Visual Embed SDK code
customCSS: {
// ThoughtSpot variables declared inline
variables: {
"--ts-var-button--secondary-background": "#F0EBFF",
"--ts-var-button--secondary--hover-background": "#E3D9FC",
"--ts-var-root-background": "#F7F5FF",
},
// CSS selectors declared inline, with syntax for declaring multiple CSS properties
rules_UNSTABLE: {
'{selector1}' : {
"{css-property-name}" : "{value}!important",
"{css-property-name2}" : "{value}!important"
},
'{selector2}'...
}
},
},
* }
*/
embedCssStyles?: Record<string, string | number>;
appOptions?: {
isMobile?: boolean;
isPrintMode?: boolean; // export mode on/off
Expand Down

0 comments on commit 502e476

Please sign in to comment.