Skip to main content
Erin Cannon
Inspiring
April 25, 2022
Question

Customizing Code Colors specific to text?

  • April 25, 2022
  • 3 replies
  • 452 views

Hi all.  I am wondering if it's possible to change the code of color or SPECIFIC comments only?  I am aware that I can customize the code theme file to change various tags, etc.  However, I have a file that someone else will be working on to make minor color / link changes and need to make sure they know where to do this.  So I want to change all comments that are <!--CHANGE HERE--> to it's own color.  Is this possible? 

The following changes ALL comment colors - in this instance to a yellow background highlight. ".cm-comment {background-color: yellow}"   Is there something I can modify on this to reach my goal?


Thanks all!!

    This topic has been closed for replies.

    3 replies

    Legend
    April 25, 2022

    A good reason to get decent editor which provides the options of adding TODO comments which are listed in a TODOs window - when each of the TODOs in the window is clicked on it jumps you straight to the place in the code where the TODO comment has been left.

     

    I dont know if Dreamweaver has the options of Bookmarks, that could be another possibility.

     

     

    Erin Cannon
    Inspiring
    April 25, 2022

    That would be a handy feature for sure!

    Nancy OShea
    Community Expert
    Community Expert
    April 25, 2022

    No.  Instead of colors, try varying the comment formatting.

     

    <!--regular html comment-->

    /*regular css comment*/

    //regular js comment

     

    <!--------------SPECIAL HTML COMMENT HERE-------------> 

    /**********SPECIAL CSS COMMENT HERE********/

    //////////////SPECIAL JS COMMENT HERE//////////////

     

    Nancy O'Shea— Product User & Community Expert
    Erin Cannon
    Inspiring
    April 25, 2022

    Thanks Nancy, am I able to assign formatting to the other two types of comments like I can with the .cm-comment tag on HTML comments?

     

    Nancy OShea
    Community Expert
    Community Expert
    April 25, 2022

    You'll have to manually type your special comments.

     

    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    April 25, 2022

    As far as I've ever seen, no, there's nothing in Brackets (DW's Code Engine) that can modify the colors of some HTML comments, but not others. 

    Erin Cannon
    Inspiring
    April 25, 2022

    Thank you Jon.  I appreciate your response.  I hadn't found anything either.