AMP 浏览器支持? [英] AMP browser support?

查看:33
本文介绍了AMP 浏览器支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看 AMP 规范,鉴于自定义样式元素依赖于 CSS 变量,这意味着当前的浏览器支持范围很窄.请参阅:我可以使用参考资料

我猜非自定义样式有一个优雅的回退",因为不理解 CSS 变量的浏览器只会忽略该 CSS.

是否有针对 AMP 的浏览器兼容性/支持矩阵?

解决方案

浏览器支持

<块引用>

总的来说,我们支持 Chrome、Firefox、Edge、Safari 和 Opera 等主要浏览器的 2 个最新版本.我们支持这些浏览器的桌面、手机、平板电脑和网络视图版本.

除此之外,核心 AMP 库和内置元素应旨在提供非常广泛的浏览器支持,我们接受针对市场份额超过 1% 的所有浏览器的修复.

特别是,我们试图保持它可能不完美但没有损坏"-支持 Android 4.0 系统浏览器和手机上的 Chrome 28+.

来自amp 常见问题

但是……CSS 变量?

CSS 自定义属性(又名 CSS 变量)的使用是polyfill:

<块引用>

更复杂和嵌套的 AMP HTML 组件……可以使用一组明确定义的 CSS 自定义属性设置样式.这些将传播到由运行时动态创建的任何子元素,以实现所需的样式.

来自spec/amp-html-components.md

Looking at the AMP spec, given the reliance on CSS variables to custom style elements, this means current browser support is narrow. See: Can I use reference

I'm guessing there is a 'graceful fallback' to non custom styled, since browsers not understanding the CSS variables will just ignore that CSS.

Is there a browser compatibility/support matrix for AMP?

解决方案

Browser Support

In general we support the 2 latest versions of major browsers like Chrome, Firefox, Edge, Safari and Opera. We support desktop, phone, tablet and the web view version of these respective browsers.

Beyond that the core AMP library and builtin elements should aim for very wide browser support and we accept fixes for all browsers with market share greater than 1 percent.

In particular, we try to maintain "it might not be perfect but isn't broken"-support for the Android 4.0 system browser and Chrome 28+ on phones.

from amp faq

But.. CSS Variables?

The use of CSS custom properties (aka CSS Variables) is polyfilled:

AMP HTML components that are more complex and nested … may be styled with an explicitly defined set of CSS Custom Properties. These are propagated to any children elements that are dynamically created by the runtime, to achieve the desired style.

from spec/amp-html-components.md

这篇关于AMP 浏览器支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆