Title
Migrating cascading style sheets to preprocessors by introducing mixins.
Abstract
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 mixins that professional developers introduced in websites and Style Sheet libraries, and can safely migrate real CSS code.
Year
DOI
Venue
2016
10.1145/2970276.2970348
ASE
Keywords
Field
DocType
Cascading style sheets, refactoring, duplication, migration
CSS code,Style sheet language,Programming language,Software engineering,Computer science,Cascading Style Sheets,Presentation semantics,Style sheet,Code reuse,HTML,Code refactoring
Conference
ISSN
ISBN
Citations 
1527-1366
978-1-5090-5571-5
4
PageRank 
References 
Authors
0.42
26
2
Name
Order
Citations
PageRank
Davood Mazinanian11097.58
Nikolaos Tsantalis274332.14