Skip to content

Commit 9090a96

Browse files
edits
1 parent 5e3b6ee commit 9090a96

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

modules/ROOT/pages/customize-icons.adoc

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can customize the icons on a ThoughtSpot page using an icon sprite SVG file
1010

1111
To override an icon:
1212

13-
. Open the ThoughtSpot application page and locate the icon that you want to replace.
13+
. Open the ThoughtSpot application page and locate the icon you want to replace.
1414
.. Right-click on the icon and select *Inspect*.
1515
.. Inspect the `<svg>` element.
1616
.. Note the icon ID.
@@ -70,7 +70,7 @@ image::./images/post-icon-override.png[After icon override]
7070
|======
7171
7272
== Creating an icon override
73-
The basic structure of an icon override file is:
73+
The basic structure of an icon override file is shown in the following snippet:
7474
7575
[source,svg]
7676
----
@@ -86,16 +86,17 @@ The `<path />` portion within the `<symbol>` tags is the definition of the actua
8686
8787
You are defining a small icon, so it should fit within a square boundary and have a single solid color.
8888
89-
There are many simple SVG icon examples available online (link:https://www.svgviewer.dev/[here for example]).
89+
There are many simple SVG icon examples available online, for example, the link:https://www.svgviewer.dev/[SVG viewer site, window=_blank].
9090
9191
You only need to copy the `<path>` tags from your example SVG within the `<symbol> </symbol>` tags.
9292
9393
=== viewBox property
94-
The *link:https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox[viewBox property^]* is in the order `min-x`, `min-y`, `width`, and `height`.
94+
95+
The link:https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox[viewBox property^] is in the order `min-x`, `min-y`, `width`, and `height`.
9596
9697
The first two properties should be `0 0` while the second should match any `width` and `height` properties from the source of your SVG paths.
9798
98-
`width` and `height` may be directly in the `<svg>` tag directly or as part of `viewBox` property in that tag, or perhaps another tag above the `<path>` tags. Use whatever values from your source SVG in the `viewBox` property of the `<symbol>` tag within your override file.
99+
The `width` and `height` properties may be added directly in the `<svg>` tag, or as part of `viewBox` property in that tag, or perhaps in another tag above `<path>`. Use the values from your source SVG in the `viewBox` property of the `<symbol>` element within your override file.
99100
100101
=== fill property
101102
You can add the `fill` property to the `<symbol>` tag to define a different fill color than the default:
@@ -106,19 +107,23 @@ You can add the `fill` property to the `<symbol>` tag to define a different fill
106107
----
107108
108109
== Testing an icon override file
109-
The link:https://try-everywhere.thoughtspot.cloud/v2/#/everywhere/playground/search[Visual Embed SDK Playground^] allows you to easily try out the icon customization framework.
110-
111-
If you check the *Apply custom styles* box, the `customizations` section appears with the default for CSS.
110+
The +++<a href="{{navprefix}}/dev-playground">Visual Embed SDK Playground </a>+++ allows you to try out the icon customization framework.
112111
113-
Paste the following over the entire customization section that appears in the code window:
112+
To view the code for customization:
114113
114+
. Select the *Apply custom styles* checkbox in the Playground. +
115+
The `customizations` code appears for CSS modifications appears in the code panel.
116+
. Replace the `customization` section with the following code and click *Run* to view the results:
117+
+
115118
[source,JavaScript]
116119
----
117120
customizations: {
118121
iconSpriteUrl: "https://cdn.jsdelivr.net/gh/thoughtspot/custom-css-demo/icon-override1.svg"
119122
}
120123
----
121124
122-
In the public playground linked above, anything from `cdn.jsdeliver.net` is already allowed.
123-
124-
On your own cluster, make sure to allow any domain you will host the SVG file from via xref:security-settings.adoc[security settings], in the *CSP img-src domains* section.
125+
[NOTE]
126+
====
127+
The `cdn.jsdeliver.net` domain is allowed on ThoughtSpot Embedded link:https://try-everywhere.thoughtspot.cloud/v2/#/everywhere/playground/search[public playground] and trial sites.
128+
On your ThoughtSpot application instance, make sure to add the domain that will host the SVG file to xref:security-settings.adoc#csp-trusted-domain[the *CSP img-src domains* allowlist].
129+
====

0 commit comments

Comments
 (0)