Atlassian的Jira中的CSS类名称被混淆了 [英] CSS class names in Atlassian's Jira are obfuscated

查看:122
本文介绍了Atlassian的Jira中的CSS类名称被混淆了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Jira中注意到,它们混淆了CSS类,因此它们看起来很奇怪,并且每次刷新页面时它们都不同:

I noticed in Jira, they have obfuscated the CSS classes, so they look odd and they are different on every page refresh:

            <div class="sc-dYaWWc dJrjAK">
                <div class="sc-iLVaha hfGHeD">
                    <div class="sc-geAxOV krrXnm">
                        <div class="sc-bJT2cE bPFEwh">
                            <div class="sc-imDrJI jKvdHw">
                                <div class="sc-hAhkBK epXQAj">
                                ...

此背后的动机是什么,也许是为了防止爬网程序或其他安全问题?对于一般的应用程序开发,这是值得的做法吗?

What is the motivation behind this, maybe to prevent crawlers or other security concerns? Is it a worthwhile practice for general app development?

推荐答案

混淆/混乱的CSS类名称的主要原因是 使用CSS模块 以提供样式封装和缩小大小.

The main reason of obfuscated/scrambled CSS class names is the usage of CSS modules to provide style encapsulation and size reduction.

样式封装(和样式泄漏)在网络上仍然是一个很大的问题,尤其是当网络应用和网站变得越来越复杂时他们的一生.

Style encapsulation (and style leakage) is still a great issue on the web, especially when web apps and sites becoming more-and-more complex over their lifetime.

很快 (希望如此) ,我们将拥有 在所有浏览器中 ,直到那时,都需要某种形式的模块化CSS解决方案来正确封装样式. 查看有关此的文章 .

Soon (hopefully), we'll have Shadow DOM capabilities in all browsers, until then some form of modular CSS solution is needed to properly encapsulate styles. Check out this article about it.

总结:

CSS模块提供模块化, 可重复使用的跨浏览器解决方案:

CSS Modules provide modular, reusable, and cross-browser solutions for:

  • 无冲突的样式
  • 直接和清除样式依赖项
  • 避免全局范围
  • Conflictless styles
  • Direct and clear style dependencies
  • Avoiding global scopes


反应 Vue 使用自己的他们的构建链中解决此问题的方法. 大多数现代MV *框架都以某种形式使用CSS模块.


React, Angular and Vue use their own solutions to this problem in their build-chain. Most modern MV* frameworks use CSS modules in some form.

当然,使用CSS模块的另一个好处是最初更复杂的方法,可以成功地抓取特定网页的内容.

And of course, one other benefit of using CSS modules is the initially more complex methods to successfully scrape the content of the specific web page.

这篇关于Atlassian的Jira中的CSS类名称被混淆了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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