<commit_before>package io.youi.theme

import io.youi.font.{FontAwesome, FontAwesomeIcon}
import io.youi.theme.StyleConnect.withElement
import io.youi.theme.mixins.HTMLFontTheme

trait FontAwesomeViewTheme extends HTMLComponentTheme with HTMLFontTheme {
  lazy val value: StyleProp[FontAwesomeIcon] = style[FontAwesomeIcon]("value", FontAwesome.None, Some(new StyleConnect[FontAwesomeIcon] {
    override def init(theme: Theme, v: StyleProp[FontAwesomeIcon], name: String): Unit = {
      var previous = Option.empty[FontAwesomeIcon]
      v.attachAndFire { icon =>
        withElement(theme) { e =>
          previous.foreach { i =>
            e.classList.remove(i.prefix)
            e.classList.remove(s"fa-${i.name}")
          }
          if (icon != FontAwesome.None) {
            e.classList.add(icon.prefix)
            e.classList.add(s"fa-${icon.name}")
            previous = Some(icon)
          } else {
            previous = None
          }
        }
      }
    }
  }), updatesTransform = false)
}<commit_msg>Fix to FontAwesomeViewTheme to update transform when value changes<commit_after>package io.youi.theme

import io.youi.font.{FontAwesome, FontAwesomeIcon}
import io.youi.theme.StyleConnect.withElement
import io.youi.theme.mixins.HTMLFontTheme

trait FontAwesomeViewTheme extends HTMLComponentTheme with HTMLFontTheme {
  lazy val value: StyleProp[FontAwesomeIcon] = style[FontAwesomeIcon]("value", FontAwesome.None, Some(new StyleConnect[FontAwesomeIcon] {
    override def init(theme: Theme, v: StyleProp[FontAwesomeIcon], name: String): Unit = {
      var previous = Option.empty[FontAwesomeIcon]
      v.attachAndFire { icon =>
        withElement(theme) { e =>
          previous.foreach { i =>
            e.classList.remove(i.prefix)
            e.classList.remove(s"fa-${i.name}")
          }
          if (icon != FontAwesome.None) {
            e.classList.add(icon.prefix)
            e.classList.add(s"fa-${icon.name}")
            previous = Some(icon)
          } else {
            previous = None
          }
        }
      }
    }
  }), updatesTransform = true)
}
{'fraction_non_alphanumeric': 0.11396011396011396, 'fraction_numerical': 0.0, 'mean_word_length': 2.6771378708551485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5711161', 'n_tokens_mistral': 648, 'n_tokens_neox': 641, 'n_words': 118}