Skip to main content

Use percentage for size variables


Show first post

56 replies

Eva_Willebrands

To have percentages in autolayout would also be great. Or maybe you can make this dependent on grid, so that you can specify a number of columns for example in a grid of 12 columns. You would als have to take the gaps between columns into account so that is a little more complex.


S_e_b_a_s_t_i_a_n

Kind of weird, because there are some cases where relative values (%) are possible like here (letter spacing):

image

And when appling a variable it only supports pixels:

That’s bad and should be supported.


Ge0
  • 3 replies
  • June 30, 2024

+1 Strongly needed. For instance, during development, I always use the ‘calc’ function for mobile sizing. For example:

@media screen and (max-width: 479px) {
    html {
        font-size: calc(0.75rem + 0.42vw);
    }
}

This method is efficient and generally ensures that everything fits perfectly with minimal adjustments. The challenge, however, is keeping the mobile designs in Figma synchronized with the actual scaling used in the developed version. Therefore, utilizing relative size units would be optimal, especially when combined with ‘calc’ to mix different size units. Additionally, incorporating the frame width as ‘vw’ should be quite feasible. It should also be possible to set a base font size in Figma for specific frame widths.

Please add 😇


Michael_Staton

Please dear God, prioritize this. It would save SO much work.


Michael_Staton

Yeah that’s how it should actually work, but that’s not the way it works in Figma. Causes so much pain and violations of the DRY principle.


John_Jackson

I don’t understand how this is still unsupported. Figma has built in percentage support for things like line height. Why in the world would they release variables without supporting percentages?


  • 1 reply
  • July 22, 2024

PLEASE for corner radius and stroke, too.


davestewart

Another +1 here.

Tried to save line-height percentages as variables (i.e. "loose": "200%" ) and it seems they are unsupported, even as strings.

CleanShot 2024-07-23 at 15.12.47


Shayne
  • 7 replies
  • August 1, 2024

Upvote for variables using percentage. Would definitely use this feature.


Juan_Guzman
  • New Member
  • 2 replies
  • August 4, 2024

Absolutely +1 for this feature


Lea_Rosental

+1 also for the Topic and there are many more ideas around percentage: Fr/Percent units for more control over auto layout content


goatdev
  • 2 replies
  • August 30, 2024

@atien +1 for this feature. Will also be especially useful for things like line-height and letter spacing. We use unitless values in CSS not fixed px values which could vary between fonts and modes.


Jakob_Schleenvoigt

Absolutely a good idea. Need it for line height and letter spacing.


LXNDR
  • 3 replies
  • September 12, 2024

I feel like this feature is almost a requirement to have considering modern webdev principles. Percents should also be applied to the Variables features. Currently there is only a “Number” variable, which is just limited to floating point numbers, very limited application.

The only cases I can see that it may cause issues is for values that aren’t entirely tied to dimensions, but for line-height. This kind of case, should always be relative to the font-size (e.g. if Variable-A = 150% or 1.5x, and another variable Font-Size = 16, a third variable Header = Font-Size * Variable-A wold result in Header = 24)

This could also help with opacities in colors and pass through %.

Overall, the feature would help to streamline not just the concern for responsive design, but also unify other features as well.


Matty_Vazquez
  • New Participant
  • 29 replies
  • September 18, 2024

Yes, this is needed! Also seems to tie in with these threads about % as well:


Nora_Leca
  • 2 replies
  • September 24, 2024

+10000, I find responsive designing for handoff to devs SO tedious, borderline unusable in Figma, without a whole lot of variable malarky to set up breakpoints with max & min widths for like 5 screen sizes.

If percentages were just a thing, it could be truly fluidly responsive for maybe just 2 screen sizes, mobile & tablet+, and usable outside of the flexbox ‘fill width’ model which doesn’t allow for fully custom design by a grid (5/3 columns designs on an 8 column grid, 6/3 columns on a 9 column, etc).


Johan_Eilertsen

This is needed! Any progress Figma crew?


Allen_Z
  • 7 replies
  • November 5, 2024

So development time from Figma was used on a new UI that is not as functional as the previous UI was, but percentages STILL haven’t been added?! Come on Figma! Get your priorities straight. Give the users what they are ASKING FOR, not what you hope they will like.


dbybanez
  • 1 reply
  • November 8, 2024

+100000 This would definitely help when designing data tables especially when you want a column to have a specific percentage based on the table’s width.


Phil_Wornath1

Needed here as well - be it allowing float values (e.g. 1.2) or even 100% as string would do. But strings are not allowed - why? . Now we need to manually convert all values later in deployment have another manual conversion sheet for all the font styles…


ilil_hitin

Does Figma developing a percentage for size variables?
It is crucial for building cross-platform applications as there are countless screen sizes…


Cristian_Ghita

this is crucial. use cases are endless. Especially since designing fluid layout’s is becoming more and more crucial with the rise of foldable devices


Mathias_Stav

Not being able to use percentage in variables for line height is a huge blocker. Could you flip it around and instead make it possible to interpet numbers as a percentage value if used in line-height? I mean, we already have the possibility of defining percentage in the line height field. Please look into this 🙏


ari3
  • 8 replies
  • December 17, 2024

This is such a frustrating gap in Figma’s abilities. I can’t fathom why it’s not a priority.


Chien-Ju_Peng1

We are building the design system using variables, and we need letter spacing to support the percentage value variable because we need to quickly convert from percentage to em instead of using the pixel.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings