lets(
/* Build a list of "styles" where the label contains "=" */
styles, prop("Advanced Styles").filter(current.contains("=")),
/* Build a list of "colors" where the label contains "Color: " */
colors, prop("Advanced Styles").filter(current.test("Color: ")),
/* Build a list of "bgs" (backgrounds) where the label contains "Background: */
bgs, prop("Advanced Styles").filter(current.test("Background: ")),
/* Override "styles". If none, return an empty string. If any we split on the " = " and return the second item in the returned list which will be our style token. Join these all together into one string */
styles, styles.empty() ? "" : styles.map(current.split(" = ").last()).join(""),
/* Same thing with "colors", but we split on "Color: " and return the color name. We can only apply one so we take the first. */
colors, colors.empty() ? "" : colors.map(current.split("Color: ").last()).first(),
/* Same thing with "bgs" as with "colors" */
bgs, bgs.empty() ? "" : bgs.map(current.split("Background: ").last() + "_Background").first(),
/* Our return result takes the name, applies styles, adds colors and backgrounds */
prop("Name").style(styles).style(colors).style(bgs)
)
<aside> 📌 Ci-dessous, les formules que j'utilise le plus. Elles sont mises à jour régulièrement, avec mes notes, quand je fais des petites recherches.
</aside>