Skip to content

@media queries no longer prefixed in 1.56.1 #661

@patrickconroy

Description

@patrickconroy

Hello! I just came across a bug with something I'm working on. It seems 1.56.1 introduces an issue where @media queries are no longer prefixed. 1.56.0 works as expected. Wondering if that's intentional, and if so, is there a way we can opt-in to having @media prefixed? From the specificity change here, we're getting the wrong outcome.

Webpack

{
    loader: require.resolve('postcss-loader'),
    options: {
        postcssOptions: {
            plugins: [
                PrefixWrap('.foo'),
            ],
        },
    },
},

Code

export const something = style({
    opacity: 1,
    ['@media']: {
        'screen and (min-width: 768px)': {
            opacity: 0.25,
        },
    },
});

1.56.0 output

.foo .something {
    opacity: 1;
}
@media screen and (min-width: 768px) {
    .foo .something {
        opacity: 0.25;
    }
}

1.56.1 output

.foo .something {
    opacity: 1;
}
@media screen and (min-width: 768px) {
    .something {
        opacity: 0.25;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions