任何值为“继承”的 CSS 属性上的 ReSharper 错误

发布于 2024-12-02 08:18:07 字数 855 浏览 1 评论 0原文

我最近决定在我们的 Web 应用程序上运行 Resharper 6.0“分析解决方案中的错误”选项。在它发现了几个有效的问题之后,它让我陷入了一些CSS“错误”:(

免责声明:我不是CSS爱好者,只了解原理,所以可能会使用错误术语 - 请耐心听我说!)

在我们的 Web 应用程序中,我们有一些遵循以下一般模式的 CSS 选择器:

    .someselector{
        property:inherit
    }

此“继承”值已用于以下属性:

  • padding
  • border-width
  • Overflow

我意识到“继承”值是不一定跨浏览器兼容,但我并不担心(目前)。我不明白的是,为什么 ReSharper 会放弃它的用途,因为我的研究表明它是一个有效的 CSS 值(尽管没有得到广泛支持)? http://reference.sitepoint.com/css/inheritvaluehttp://www.w3.org/TR/CSS2/cascade.html#value-def-继承

我假设我对继承值及其用途不了解,并且希望有人能提供任何启发。如果经验丰富的 CSS 开发人员能够告诉我 CSS 是有效的而 ReSharper 是错误的,我同样会感到高兴。只是寻找清楚哪个是正确的!

提前致谢!

I recently decided to run the Resharper 6.0 "Analyze Errors In Solution" option on our web application. After several valid problems it picked up on, it has me stumped on some CSS 'errors':

(disclaimer: I am not a CSS person in the slightest, only understand the principles, so may use the wrong terminology - please bear with me!)

In our web application, we have some CSS selectors which follow this general pattern:

    .someselector{
        property:inherit
    }

This 'inherit' value has been used against the properties of:

  • padding
  • border-width
  • overflow

I realise that the 'inherit' value is not necessarily cross browser compatible, but I'm not worried about that (for now). What I don't understand is why ReSharper is throwing its toys over its use as from what my research shows it is a valid CSS value (albeit not widely supported)?
http://reference.sitepoint.com/css/inheritvalue and http://www.w3.org/TR/CSS2/cascade.html#value-def-inherit

I'm assuming there's something I don't know about the inherit value and its use and would appreciate any enlightenment someone can provide. I am equally happy if an experienced CSS developer can tell me the CSS is valid and ReSharper is wrong. Just looking for clarity of which is right!

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

開玄 2024-12-09 08:18:07

JetBrains 已已将此确定为问题(并链接到此问题!),并且已目标版本 6.1 进行修复。

JetBrains have already identified this as an issue (and linked to this question!), and have targetted version 6.1 for a fix.

故人爱我别走 2024-12-09 08:18:07

这已被确认为一个错误(Stack Overflow 之外),我已向 JetBrains 提交了错误报告来修复它。上面列出的 CSS 确实有效。

This has been confirmed as a bug (outside of Stack Overflow) and I have lodged a bug report with JetBrains to fix it. The CSS listed above is indeed valid.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文