PricingBlog

How to use Style Variable for editing elements.

  • uunicode-1263560751738781828

    unicodes

    1 year ago

    I have created a variable named "border-radius" with the value "0px"
    In the "div" styling I have created a style variable "border-radius" connected with the variable.
    By default the element has 15px border radius, but it does not change to 0 or to 15 as per the variable input changed by the button click.🙂
    1263560752292434040-Screenshot_2024-07-18_at_21.18.34.png
    1263560751985987624-Screenshot_2024-07-18_at_21.18.47.png
  • lucasg-1263564610364117073

    Lucas G

    1 year ago

    Did you set the style variable to the radius field?
  • uunicode-1263578800793321504

    unicodes

    1 year ago

    yes
    1263578800604840028-Screenshot_2024-07-18_at_22.30.51.png
  • uunicode-1263579062719221900

    unicodes

    1 year ago

    It work in terms of changing the output, but it has no efect on the div.
  • max.kayr-1263582428245659758

    Max

    1 year ago

    The style variables at the top of the styling panel will only create CSS variables. You will then have to assign them to the actual properties (see attached screenshots). Hope this helps
    1263582427750727730-Bildschirmfoto_2024-07-18_um_21.43.21.png
    1263582428044197888-Bildschirmfoto_2024-07-18_um_21.43.53.png
    🙏1
  • uunicode-1263585386815557765

    unicodes

    1 year ago

    It works! 🥰
  • uunicode-1263585787543552184

    unicodes

    1 year ago

    If there will be people looking to do the same, setting the variable for me worked writing var(--borderRadius). Is there a way to select?
  • max.kayr-1263587850608312341

    Max

    1 year ago

    Yes, you can select. I think that there is a bug at the moment. You need to define the variable as "spacing". Then you can select it as a border radius
  • lucasg-1263588046448754708

    Lucas G

    1 year ago

    Is it actually a bug though? 🤔
  • lucasg-1263588230083903621

    Lucas G

    1 year ago

    You click on the little diamond on the right side of the field
  • You can see it on the second image Max posted
  • uunicode-1263588348501561356

    unicodes

    1 year ago

    for radius there is no diamond
  • for color exist
  • but not for radius
  • 1263588647232471223-Screenshot_2024-07-18_at_23.09.58.png
    1263588647483998219-Screenshot_2024-07-18_at_23.09.53.png
  • 1117897194134052925-@unicodes
    yes
    lucasg-1263589419978457169

    Lucas G

    1 year ago

    The type for the variant here
  • Needs to be spacing
  • max.kayr-1263589591584346153

    Max

    1 year ago

    I do have a select option
    1263589591340941463-image.png
  • lucasg-1263590144036966581

    Lucas G

    1 year ago

    @unicodes have you set any spacing variables in your theme settings? I wonder if it doesn’t show if none are set there
  • uunicode-1263590261033009234

    unicodes

    1 year ago

    I haven't
  • Tod-1263590264052646009

    Tod

    1 year ago

    Great energy @unicodes! Your continuous contribution to the toddle Community just made you advance to Community Level 6!
  • max.kayr-1263590449881419826

    Max

    1 year ago

    That is strange... I only have a color set
  • lucasg-1263590510526861424

    Lucas G

    1 year ago

    Oh then never mind
  • uunicode-1263591088573124629

    unicodes

    1 year ago

    Regarding this project (my drop down) Now I have to create JS function to calculate two business days from today, it is possible to add js code or I have to use functions and workflow?
    1263591088430776371-Screenshot_2024-07-18_at_23.17.55.png
  • uunicode-1263591484763013131

    unicodes

    1 year ago

    Found, I have to read about cutom actions
  • lucasg-1263593786865619049

    Lucas G

    1 year ago

    But did you solve the radius variable?
  • Because that’s a bug that needs to be raised otherwise
  • might* be
  • uunicode-1263594558084612198

    unicodes

    1 year ago

    yes, solved writing the variable name var(--borderRadius)
  • lucasg-1263596993306165358

    Lucas G

    1 year ago

    I meant selecting it from the field
  • uunicode-1263601560852758568

    unicodes

    1 year ago

    No
  • I have to to this step again for making it work by selecting it.
  • uunicode-1263602720288411658

    unicodes

    1 year ago

    How to use Style Variable for editing elements.