Just released Connect.Koi 1.1 and 1.2 with two new features, which we found helpful implementing multi-CSS Framework solutions.
With the previous Koi.Css you could always get the name-tag of the current CSS framework. It would return "bs3", "bs4", "fnd5" or "unk" depending on the situation. Now for situations where you want to have prepared exactly 2-3 frameworks but not others, you would like to include a css-file like [css-tag].css - but only for the 2-3 frameworks you support. So an unsupported framework (like fnd6.css) would cause a problem. For this, we created PickCss. The syntax:
- @Koi.PickCss(list-of-supported-frameworks, alternative)
So you can now create a tag like
- <link rel="stylesheet" href="@App.Path/dist/@(Koi.PickCss("bs3,bs4", "other")).css" />
This will result in "bs3.css", "bs4.css" if one of these is the supported, and "other.css" if it's anything else.
Class with Multiple Select
Koi introduced the simple @Koi.Class helper to build class-attributes like this:
- <div @Koi.Class("bs3,bs4='xyz' fnd6='abc'") >
This is nice and compact, but quickly saw many cases where a lot of the classes were repeated, resulting in fairly long expressions. This is because each framework name was only allowed once. So we introduced this syntax:
- <div @Koi.Class("bs3,bs4='...', bs3='...' bs4='...'") >
Now, all cases of the desired class are picked out and added together. This makes for much shorter expressions in many scenarios.
You can find the latest release on github: https://github.com/DNN-Connect/connect.koi/releases
Love from Switzerland,