首页> 外文会议>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.
机译:级联样式表(Cascading Style Sheets,CSS)是用于样式化Web文档的标准语言,在行业中已广泛使用。但是,CSS缺少允许代码重用的结构(例如函数)。因此,维护CSS代码通常是一项繁琐且容易出错的任务。通过使用缺少的结构扩展CSS,引入了预处理器(例如Less和Sass)来填补这一空白。尽管使用预处理器具有明显的可维护性优势,但是目前不支持将旧CSS代码迁移到预处理器。在本文中,我们提出了一种用于自动检测CSS代码中重复样式声明的技术,该样式声明可以迁移到预处理器功能(即mixins)。我们的技术可以参数化重复声明的样式值中的差异,并确保迁移不会更改Web文档的表示语义。评估表明,我们的技术能够检测到专业开发人员在网站和样式表库中引入的98%混入,并且可以安全地迁移真实的CSS代码。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号