首页> 外文会议>IEEE/ACM International Conference on Automated Software Engineering >Migrating cascading style sheets to preprocessors by introducing mixins
【24h】

Migrating cascading style sheets to preprocessors by introducing mixins

机译:通过引入Mixins将层叠样式表迁移到预处理器

获取原文

摘要

Cascading Style Sheets (CSS) is the standard language for styling web documents and is extensively used in the industry. However, CSS lacks constructs that would allow code reuse (e.g., functions). Consequently, maintaining CSS code is often a cumbersome and error-prone task. Preprocessors (e.g., Less and Sass) have been introduced to fill this gap, by extending CSS with the missing constructs. Despite the clear maintainability benefits coming from the use of preprocessors, there is currently no support for migrating legacy CSS code to preprocessors. In this paper, we propose a technique for automatically detecting duplicated style declarations in CSS code that can be migrated to preprocessor functions (i.e., mixins). Our technique can parameterize differences in the style values of duplicated declarations, and ensure that the migration will not change the presentation semantics of the web documents. The evaluation has shown that our technique is able to detect 98% of the mix-ins that professional developers introduced in websites and Style Sheet libraries, and can safely migrate real CSS code.
机译:级联样式表(CSS)是造型Web文件的标准语言,在行业中广泛使用。但是,CSS缺少构造,允许代码重用(例如,函数)。因此,维护CSS代码通常是一个繁琐和易于忽略的任务。通过将CSS与缺失的构造扩展,已经引入预处理器(例如,少和SASS)以填补这种差距。尽管使用预处理器的明确可维护性效益,但目前没有支持将遗留CSS代码迁移到预处理器。在本文中,我们提出了一种用于在可以迁移到预处理器函数的CSS代码中自动检测重复样式声明的技术,该技术可以迁移到预处理器函数(即,MixIns)。我们的技术可以参数化重复声明的样式值的差异,并确保迁移不会更改Web文档的演示语义。评估表明,我们的技术能够检测网站和风格表库中引入的专业开发人员的98%的混合物,并可以安全地迁移真正的CSS代码。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号