Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: css gets mangled with :root #107

Open
kitsguru opened this issue Jul 9, 2024 · 0 comments
Open

BUG: css gets mangled with :root #107

kitsguru opened this issue Jul 9, 2024 · 0 comments

Comments

@kitsguru
Copy link

kitsguru commented Jul 9, 2024

I have this block of CSS in a Twig template that gets mangled when saved. If I remove the type="text/css" the extension goes into an infinite loop when attempting to save.

<style type="text/css">
    :root {
        --header-bg-color: var(--bs-light);
        --header-color: var(--bs-primary);
        --header-height: auto;
    }

    .header-bg {
        height: var(--header-height);
        background: var(--header-bg-color);
        color: var(--header-color);
    }

    @media (min-width:  576px) {
    /* small */
        .header-bg {
            height: auto;
            background: transparent url({{img.thumbUrlPath3 }}) center center;
            background-size: cover;
        }
    }

    @media (min-width:  768px) {
    /* medium */
        .header-bg {
            background: transparent url({{img.thumbUrlPath2 }} ) center center;
            background-size: cover;
        }
    }

    @media (min-width:  992px) {
    /* large */
        .header-bg {
           background: transparent url({{img.thumbUrlPath }} ) center center;
           background-size: cover;
        }
    }

    @media (min-width:  1200px ) {
    /* x-large and xx-large */
        .header-bg {
           background: transparent url({{img.urlPath }} ) center center;
           background-size: cover;
        }
    }
</style>

The workaround was to move the CSS to a separate file as pure CSS and then embed the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant