Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Nielsen 159 posts 257 karma points
    Mar 08, 2023 @ 11:53
    Peter Nielsen
    0

    CSS is not being loaded with package.manifest

    Hi

    I have this package.manifest for a plugin playing around with the new GridBlocks.

    My package.manifest looks like this

    ```

    {
    "gridEditors": [
        {
            "name": "Code",
            "alias": "code",
            "view": "~/App_Plugins/GridTest/gridtest.html",
            "icon": "icon-code",
            "config": {
                "color": "red",
                "text-align": "right"
            }
        }
    ],
    "javascript": [
        "~/App_Plugins/GridTest/svelte/svelte-components.js",
        "~/App_Plugins/GridTest/grid-controller.js"
    ],
    "css": [
        "~/App_Plugins/GridTest/svelte/svelte-tailwind.css"
    ]}
    

    As you can see I import the svelte-tailwind.css. I am sure the path is right. But inside of my block grid element, I cant see the styling being shown in the elements. I can see the tw css variables in devtools, so I can see the css is being loaded, but the classes isn't hit by the selector. I have tried without the #umbracoBlockGrid as well.

    See screenshots here.

    enter image description here

    enter image description here

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Mar 08, 2023 @ 12:37
    Huw Reddick
    1

    Hi Peter,

    Have you added a ref to the css on the block itself?

    enter image description here

  • Peter Nielsen 159 posts 257 karma points
    Mar 08, 2023 @ 14:18
    Peter Nielsen
    0

    Hi Huw

    Ah I didn’t think of that. It worked. But why doesn’t the other thing work? I can see the CSS variables being loaded into my dom root, so the css is being loaded but the classes doesnt work?!

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Mar 08, 2023 @ 15:42
    Huw Reddick
    100

    I'm afraid I can't answer that bit :D but you probably don't need the css in the package manifest at all.

  • Peter Nielsen 159 posts 257 karma points
    Mar 08, 2023 @ 15:46
    Peter Nielsen
    0

    No maybe not. It feels like it its scoped in some way. Just cant figure out how. But thanks. You got me in the right direction :)

Please Sign in or register to post replies

Write your reply to:

Draft