Skip to main content
Erin Cannon
Inspiring
Apr 25, 2022 3:42 PM UTC
Question

Customizing Code Colors specific to text?

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 is closed to new replies. Start a new post to keep the conversation going.

    9 replies

    Legend
    Apr 25, 2022 7:20 PM UTC

    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.

     

     

    Translate
    Erin Cannon
    Inspiring
    Apr 25, 2022 7:23 PM UTC

    That would be a handy feature for sure!

    Translate
    Nancy OShea
    Community Expert
    Community Expert
    Apr 25, 2022 5:44 PM UTC

    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//////////////

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    Erin Cannon
    Inspiring
    Apr 25, 2022 5:47 PM UTC

    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?

     

    Translate
    Nancy OShea
    Community Expert
    Community Expert
    Apr 25, 2022 5:55 PM UTC

    You'll have to manually type your special comments.

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    Apr 25, 2022 5:05 PM UTC

    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. 

    Translate
    Erin Cannon
    Inspiring
    Apr 25, 2022 6:02 PM UTC

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

     

    Translate