Defaulting the scale to a larger size for all calcite icons on the sketch widget

481
3
02-09-2023 04:54 AM
nevvo
by
New Contributor II

Hello there,

Is it possible to default the scale property on the icon here: https://developers.arcgis.com/calcite-design-system/components/icon/#api-reference

When I am creating a new sketch widget and specifying the available tools / visible elements using the OOB widget: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#visibleElemen...

The default scale property sets them to 's' and due to where I am hosting the map the styling on the page makes these appear really small.

I can use jQuery to enumerate all the calcite-icons on the page bump the scale up to 'm' but was looking for a more OOB solution if possible.

Thanks

 

 

3 Replies
AspenN
by
Occasional Contributor

We are also noticing the same problem with the calcite icons defaulting to the small scale rather than the medium. How did you manage to use jQuery to adjust the scale to medium?

0 Kudos
nevvo
by
New Contributor II

I basically did what I mentioned above - after the map and view have rendered, I determine the mode that the map is being rendered in and I bump the icon size up based on that: 

const isForm = $(location).attr("href").toLowerCase().contains("/runtime/form/");
const scale = isForm ? "l" : "m";

// Set the scale for all calcite icons.
$("calcite-icon").attr("scale", scale);

Thanks

0 Kudos
JonasDePelsmaeker
New Contributor II

I'm also experiencing this behaviour, thanks for sharing your solution.
I'd also like an out-of-the-box solution.

0 Kudos