Scoped UIKit

  • Hi,

    Tried to get a question answered at discord but no luck. Let me try here: I want to use a scoped version of UIKit3 (so I can use the gallery extensions smooth with Uikit2 and 3 themes). What I don't get is the following in the UIKit documentation. I did a scoped version of UIKit and also compiled it with prefix mercator

    Code
    1. Now you need to tell uk-modal, uk-tooltip and uk-lightbox where to append themselves into the DOM when they do not have the container option set, e.g. the default container for said components. To do so, set the following parameter:
    2. //simply pass the selector
    3. UIkit.container = '.uk-scope';
    4. ...
    5. //or you can set an element directly, for example:
    6. UIkit.container = document.getElementById('#id-of-scope-element');

    I tried:

    Code
    1. mercatorUIkit.container = '.mercator-scope';

    It seems to work for sliders but not for light boxes. Any idea what I must do to get the light boxes work with the scoped version?


    Thanks,

    Mercator

  • I guess the lightbox's html gets amended to the body, so it will not be in the inside the scoped tag.

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

  • I guess the lightbox's html gets amended to the body, so it will not be in the inside the scoped tag.

    It must be possible somehow as it reads int the documentation: Now you need to tell uk-modal, uk-tooltip and uk-lightbox where to append themselves into the DOM

  • I guess in easiest way it would be switch able through the backend, but tbh uikit 2 is a dead horse.

    Switching in the backend: An then produce UIKi2 or UIKit3 code. Yes, that would probably be possible but as you say: UIKit2 is a dead horse and I don't want to feed dead horses. Though there is a saying: Even a dead horse is not as that that you cannot ride it...:)

  • I checked the uikit docs. I can't find an option to configure where to append the modal ...

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

  • You could open an issue at their repo, as this breaks some functionality of the scoped uikit version. I think the'll fix that when mentioned for the final release.

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7