# Perspective Text Shrinking

**URL:** <https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 19, 2023, 9:19pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819 "2023-01-19T21:19:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [January 19, 2023, 9:19pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/1 "2023-01-19T21:19:37Z")

</div>

Hello all,

Is it possible to make the text of the labels shrink when the view is on a smaller screen?

When resize my views, the components shrink as expected, but the text does not and looks ugly! ☹

Thanks,  
Mike

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 19, 2023, 9:36pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/2 "2023-01-19T21:36:30Z")

</div>

It might be important to say what view type you're using. Flex, coordinate, ...

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [January 19, 2023, 9:55pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/3 "2023-01-19T21:55:34Z")

</div>

Flex containers. Nested flex. Flex - Coord - Flex. Flex - Flex

couple of different options.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 19, 2023, 10:10pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/4 "2023-01-19T22:10:25Z")

</div>

> [@Perspective dynamic font sizing](https://forum.inductiveautomation.com/t/perspective-dynamic-font-sizing/47866/16):
>
> @nminchin, would using the vmin/vmax along with the clamp function help you out? For example: clamp(6px, 0.5 \* (1.0vmin + 1.0vmax), 20px) At least that way you can limit the maximum text size.

Text sizing in Perspective is a bit of a funny one. Best to create styles for different font sizes with these expressions and use the styles in your components.

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [April 6, 2023, 10:31pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/5 "2023-04-06T22:31:54Z")

</div>

What are these units and where do you find them:  
`vw, vh, vmin, vmax`.

I recognize `em` from HTML coding.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 6, 2023, 10:44pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/6 "2023-04-06T22:44:57Z")

</div>

Google 🙂 they're CSS units

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 7, 2023, 7:42am UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/7 "2023-04-07T07:42:51Z")

</div>

It's not html but css.

You should indeed google it for more info, but to summarize:  
vw: 1vw = 1% of viewport width  
vh: 1vh = 1% of viewport height  
vmin: if width \> height, 1vmin = 1vh else 1vmin = 1vw  
vmax: if width \> height, 1vmax = 1vw else vmax = 1vh

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [April 7, 2023, 3:55pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/8 "2023-04-07T15:55:30Z")

</div>

Have you tried using params in the text size calculation? I have not yet been successful. I think I'll utilize project inheritance for creating styles with this.

I did find those descriptions on a Mozilla site too. [https://developer.mozilla.org/en-US/docs/Web/CSS/length](https://developer.mozilla.org/en-US/docs/Web/CSS/length)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 7, 2023, 3:59pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/9 "2023-04-07T15:59:56Z")

</div>

I'm not sure what you mean.  
What are you trying to do with parameters ?

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [April 7, 2023, 4:02pm UTC](https://forum.inductiveautomation.com/t/perspective-text-shrinking/68819/10 "2023-04-07T16:02:22Z")

</div>

Well I was attempting to set up a view with some labels and use custom props/params to pass values for the calculations:

```auto
clamp(6px, 1.25 * (0.25vmin + 1.0vmax), 20px)
calc(0.5vw + 0.5vh + 0.5vmin + 0.5em)

```

using custom props would make changing values easier than going to the label, expanding the text, changing it, saving it...

I don't think I can use props in this situation tho.
