Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Customizing Code Colors specific to text?

Community Beginner ,
Apr 25, 2022 Apr 25, 2022

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

267
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2022 Apr 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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 25, 2022 Apr 25, 2022

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2022 Apr 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 & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 25, 2022 Apr 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?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2022 Apr 25, 2022

You'll have to manually type your special comments.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 25, 2022 Apr 25, 2022

This doesn't appear to work.  I am in an HTML only file.  So the commenting for the other two types actually shows on the live page.

The HTML comments are what I am needing to be able to use - but looking to format only the ones shown here so they pop out - and still be able to have others that don't (currently the others have all been removed in this screen shot.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2022 Apr 25, 2022

CSS comments are for use inside CSS files or inside <style> </style> tags only.

 

JS comments are for use inside JavaScript files or inside <script> </script> tags only.

 

 

 

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 25, 2022 Apr 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.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 25, 2022 Apr 25, 2022
LATEST

That would be a handy feature for sure!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines