elm-css:elm-css 9.0 中的 mixin 发生了什么变化?

elm-css: What happened to mixins in elm-css 9.0?

当我从 elm-css 8.x 升级到 9.0 时,我的代码崩溃了。看起来 mixin 不再出现在文档中。他们发生了什么,或者mixins被什么取代了?

似乎 Mixin 已替换为 Style。您可以编写 Styles 来制作其他 Styles(这本质上就是 mixin 在 Sass 或 Less 等预处理器中的用途)

这个 Elm 代码 ...

greenOnHover : Mixin
greenOnHover =
   mixin
        [ hover [ color (rgb 0 0 122) ]
        ]

应替换为

greenOnHover : Style
greenOnHover =
    batch
        [ hover [ color (rgb 0 0 122) ]
        ]

There is some information in this pull request