html - How do i prevent Next.js from converting @media from max-width to "<=" format? - Stack Overflow

In my Next.js project I have a CSS file with a responsive rule:@media screen and (max-width: 1080px) {

In my Next.js project I have a CSS file with a responsive rule:

@media screen and (max-width: 1080px) {
  .content-box {
    flex-direction: column;
  }
}

This rule is correctly applied on my desktop browsers, however it isn't working on my mobile (375px innerWidth). The content-box is not changed to column. Debugging with Safari I can also see that the rule is not being applied.

When I examine the project source code, I see that Next JS has generated its own CSS file called "styles_f15045._.css"

This CSS file has converted my rule to use the <= format:

@media screen and (width <= 768px) {...}

This seems to be what is causing the problem, as when I add the @media rule directly in a style tag, it works as expected.

Is it possible to change the way Next.js repackages my CSS? Or is there another common solution to this issue?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745061324a4608983.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信