Fork me on GitHub

Hi all, thanks for the cool library (ornament), it really does allow for some neat and tidy component ‘inheritance’ (for lack of a better word). I’ve been noodling about with namespaced Girouette rules as I have a bunch of rules that are only used in one context, say ‘hover’ but for menu items or ‘hover’ for buttons and I’d like to just do something like:

(defstyled container container*
…where the ::hover rule is defined in the current NS. In reality it’s actually something like ::hover-primary-to-secondary but that’s not important. There are a few pieces of hackery that make it work but they are all confined in how I define the rule component (i.e., in my code) but the only missing piece that I can’t hack away is and supporting it is not a great deal of effort (on the surface it seems that way at least!). A minimal change, for example, is something like:
(keyword? rule)
(let [rule-name (if (namespace rule)
                  (classname-for rule)
                  (name rule))
      girouette-garden (class-name->garden rule-name)])
Has this ever been considered before?


Reading the source I realise the process-tag method works really well for my use case without needing any hackery 😆


…but still wondering about the above question re. namespaced girouette keywords


Hi @U0VP19K6K, this sounds interesting but I'm not 100% sure I'm following. How do you "define" ::hover?


@U07FP7QJ0, thanks for reply 🙂 I’ll put this idea into a form (code) that’ll make it clearer for you