Reader small image

You're reading from  Less Web Development Essentials (Second Edition)

Product typeBook
Published inApr 2015
Publisher
ISBN-139781783554072
Edition1st Edition
Tools
Right arrow
Author (1)
Bass Jobsen
Bass Jobsen
author image
Bass Jobsen

Bass Jobsen has been programming the web since 1995, ranging from C to PHP. He has a special interest in the processes between designer and programmer. He works on the accessibility of Bootstrap and his JBST WordPress starters theme. With over 5 years of experience with Bootstrap, Bass has been actively contributing to the community with his blogs and Git repos.
Read more about Bass Jobsen

Right arrow

Using comments in Less


Comments make your code clear and readable for others. It is important that you are able to understand them clearly. That is why this chapter starts with some notes and examples of comments.

Tip

Don't be sparse with your comments when keeping the file size, download time, and performance in mind. In the process of compiling and minimizing your final CSS code, comments and other layout structures will be effectively removed. You can add comments for understanding and readability wherever needed.

In Less, you can add comments in the same way as you did while writing the CSS code. Comment lines are placed between /* */. Less also allows single-line comments that start with //.

Using Less, only the true CSS comments (/* */) will be included in the generated CSS file. Minimizers will remove these comments in your final compiled style sheet. An example of this can be seen in the following code:

/* comments by Bass
.mixins() { ~"this mixin is commented out"; }
*/

Nested comments...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Less Web Development Essentials (Second Edition)
Published in: Apr 2015Publisher: ISBN-13: 9781783554072

Author (1)

author image
Bass Jobsen

Bass Jobsen has been programming the web since 1995, ranging from C to PHP. He has a special interest in the processes between designer and programmer. He works on the accessibility of Bootstrap and his JBST WordPress starters theme. With over 5 years of experience with Bootstrap, Bass has been actively contributing to the community with his blogs and Git repos.
Read more about Bass Jobsen