简体   繁体   English

通过Heroku部署时,CSS在Safari上中断,但在本地运行良好吗?

[英]CSS breaks on Safari when deployed via Heroku, but works perfectly locally?

So I have a Rails app currently deployed on Heroku. 因此,我目前在Heroku上部署了Rails应用程序。 The CSS styling works perfectly when viewed via Chrome on both production and locally. 当通过Chrome在生产环境和本地环境中查看时,CSS样式都可以完美地工作。 However, using desktop Safari the styling seems to completely break when viewed on the production server. 但是,使用桌面Safari时,在生产服务器上查看时,样式似乎完全中断。 The strange thing is that Safari renders the page just fine when running the Rails app locally. 奇怪的是,当在本地运行Rails应用程序时,Safari可以很好地呈现页面。 Mobile Safari also renders the page correctly on production. Mobile Safari还可在生产中正确呈现页面。

You can view the page here. 您可以在此处查看页面。

Initially I thought that maybe the assets weren't being served correctly by Heroku, but the fact that the page renders as its supposed to on Chrome should mean that it's working fine. 最初,我认为Heroku可能无法正确提供这些资产,但是页面在Chrome上应有的渲染应该意味着它可以正常工作。

Testing on Safari, the page renders correctly when the window is resized down to mobile, so the assets/images/css are definitely loading - just not when the viewport is the size of a desktop window. 在Safari上进行测试后,将窗口调整为可移动状态时,页面可以正确呈现,因此资产/图像/ css肯定正在加载-视口只有桌面窗口的大小时才显示。

Does anyone have a guess as to what's going on? 有人对发生的事情有猜测吗?

I just have got similar problem. 我只是有类似的问题。 I suppose it's not Heroku related issue. 我想这不是与Heroku有关的问题。 In my case Safari did not like css code: 就我而言,Safari不喜欢CSS代码:

@media
only screen and (-webkit-min-device-pixel-ratio: 1.25),
only screen and ( min-device-pixel-ratio: 1.25),
only screen and ( min-resolution: 200dpi),
only screen and ( min-resolution: 1.25dppx)
{
  -webkit-font-smoothing: subpixel-antialiased;
}

Css file loaded fully but the all styles after that code completely broken and did not applied. CSS文件已完全加载,但是该代码之后的所有样式都完全损坏并且没有应用。 New line after @media - the cause of the problem. @media之后的新行-问题的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM