PricingBlog

What are Classes in Toddle?

  • lordalmighty_-1184516717846728705

    Lord Almighty

    2 years ago

    I see that Classes have been added to Toddle but I haven't seen an explanation for what they are and how they should be used
  • tomthebigtree-1184516986986836039

    Tom Ireland

    2 years ago

    @Lord Almighty - Are you referring to classes added via the 'Attributes' tab?
  • lucasg-1184518555845275759

    Lucas G

    2 years ago

    toddle has always had classes. They work differently than regular use of classes in that they only apply to the individual element which definitely has its pros and cons and can take some getting used to.
    Are you referring to style variables? If so those are awesome. They're basically CSS variables for any style field so you can dynamically update values via variables instead of using the style attribute method
  • svenning-1184519104846110760

    svenning

    2 years ago

    What @Lucas G said 👍
  • lordalmighty_-1184563095209779250

    Lord Almighty

    2 years ago

    Yes
  • 812750580543520788-@Lord Almighty
    Yes
    tomthebigtree-1184577082848710706

    Tom Ireland

    2 years ago

    I'll echo what @Lucas G said as well. If you want to apply different styles to an element and control those with formulas (needs to evaluate to true to be applied), classes are the way to go. A good example of use is dark vs light mode class application. I'm working on that very thing just now.
  • lucasg-1184578818590122024

    Lucas G

    2 years ago

  • @svenning would a video like that be useful for the watch faces idea?
  • 128651941143117824-@Lucas G
    tomthebigtree-1184589420658176040

    Tom Ireland

    2 years ago

    When you starting your YT channel? 😉
  • lucasg-1184589882492997664

    Lucas G

    2 years ago

    lol
  • andreasmoller-1184595085120262185

    Andreas Møller

    2 years ago

    That was a great explanation @Lucas G.

    The way we normally explain it is that in toddle you never style classes, you style elements.
  • lucasg-1184601652003610714

    Lucas G

    2 years ago

    I hope it's helpful 🙏 the fact that you can conditionally apply classes via variables in toddle is great and so simple.

    Something else that should be noted for those used to working with global classes or CSS frameworks is that the Theme settings do a lot of heavy lifting in replacing that need.