<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[HTML and CSS language color coding in the same document]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I’m sure this has been asked but didn’t get any useful hits in search. I sometimes code larger HTML documents with internal CSS so was wondering if there’s a way to apply color coding for both languages in the one document?</p>
<p dir="auto">CSS in an HTML document is completely unchanged. HTML in a CSS document is partly colored, but not in the same way and not properly.</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27542/html-and-css-language-color-coding-in-the-same-document</link><generator>RSS for Node</generator><lastBuildDate>Thu, 18 Jun 2026 06:47:08 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27542.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 May 2026 20:09:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HTML and CSS language color coding in the same document on Sat, 23 May 2026 19:26:49 GMT]]></title><description><![CDATA[<p dir="auto">This issue is one of the most consistently duplicated on the forum, for example:</p>
<ul>
<li><a href="https://community.notepad-plus-plus.org/post/15204">“Highlight HTML and CSS”</a></li>
<li><a href="https://community.notepad-plus-plus.org/post/89351">“CSS comments should be in GREEN”</a></li>
<li><a href="https://community.notepad-plus-plus.org/post/95116">“css formatting not working on embed style sheet…”</a></li>
<li><a href="https://community.notepad-plus-plus.org/search?in=titlesposts&amp;term=CSS%20HTML&amp;matchWords=any&amp;by=&amp;categories=&amp;searchChildren=false&amp;hasTags=&amp;replies=&amp;repliesFilter=atleast&amp;timeFilter=newer&amp;timeRange=&amp;sortBy=relevance&amp;sortDirection=desc&amp;showAs=topics"><em>etc.</em></a></li>
</ul>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>’s initial reply is the correct one. You can also refer to <a href="https://community.notepad-plus-plus.org/post/89390">this</a> more detailed explanation regarding the current limitations of Lexilla.</p>
<p dir="auto">For now, a relatively simple way to edit HTML documents with embedded style and script highlighting is to use the <a href="https://github.com/Thorium/NppTreeSitter/releases" rel="nofollow ugc">tree-sitter plugin</a>.</p>
<p dir="auto">Note that only “light” style themes are currently supported, and you will have to manually <a href="https://github.com/Thorium/NppTreeSitter#installation" rel="nofollow ugc">download and extract</a> the configuration files to get it working.</p>
<p dir="auto"><img src="/assets/uploads/files/1779564282293-npptreesitter-v110.png" alt="npptreesitter-v110.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/105521</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105521</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Sat, 23 May 2026 19:26:49 GMT</pubDate></item><item><title><![CDATA[Reply to HTML and CSS language color coding in the same document on Sat, 23 May 2026 14:15:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robk-blue" aria-label="Profile: Robk-Blue">@<bdi>Robk-Blue</bdi></a></p>
<p dir="auto">This all depends on what you are expecting and what Notepad++ can do vs what <em>you</em> can do.  There’s a lot of customization available to make N++ work your way, not necessarily the developer’s way.</p>
<p dir="auto">If you want to add terms to highlight,  you can use Style Configurator.<br />
Select the language, say CSS and go through the list of styles.  Some style types (PSEUDOCLASS is the first type on the list)  allow you to add user-defined keywords.  Once defined, you can use those terms in your text and they will be highlighted based on that style</p>
<p dir="auto">If you have terms that you want to have their OWN style,  you can also use the EnhanceAnyLexer plugin.  You pick a foreground color and then use a regular expression to define what receives that color.</p>
<p dir="auto">Last, and this is more work, you can create your own custom html-css language as a User-Defined Language.  I don’t believe that you can set it as the default for .html or .css files, but you can always select it instead.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105519</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105519</guid><dc:creator><![CDATA[David Brigden52]]></dc:creator><pubDate>Sat, 23 May 2026 14:15:39 GMT</pubDate></item><item><title><![CDATA[Reply to HTML and CSS language color coding in the same document on Sat, 23 May 2026 00:06:21 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Thanks for the thorough explanation. I’ve seen highlighting of both in other apps in the one document so I wonder what their overhead is for it.</p>
<p dir="auto">I suppose I must not understand the intricacies of it all, but on the surface, isn’t it just the HTML syntax highlighting, plus more or vice versa? I wouldn’t have thought coding to highlight certain terms would be that complicated.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105518</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105518</guid><dc:creator><![CDATA[Robk Blue]]></dc:creator><pubDate>Sat, 23 May 2026 00:06:21 GMT</pubDate></item><item><title><![CDATA[Reply to HTML and CSS language color coding in the same document on Fri, 22 May 2026 21:37:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robk-blue" aria-label="Profile: Robk-Blue">@<bdi>Robk-Blue</bdi></a> ,</p>
<p dir="auto">Notepad++ uses a library called “Lexilla” (written and maintained by the Scintilla team) to handle syntax highlighting.  They have chosen not to support CSS embedded in HTML.  If they don’t, Notepad++ cannot (because Notepad++ uses the syntax highlighter “lexer” code from Lexilla without customizing it – trying to customize it would be a maintenance nightmare that the Notepad++ developers have rejected on multiple occasions.)</p>
<p dir="auto">I will quote here some of what I wrote in a related <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16113#issuecomment-2627654587" rel="nofollow ugc">GitHub issue</a> a little over a year ago:</p>
<blockquote>
<p dir="auto">I confirmed that SciTE (Scintilla/Lexilla’s test-bed editor) doesn’t highlight CSS-embedded-in-HTML, either.  It’s definitely up to the Lexilla project to implement embedded CSS, unfortunately.  (I was hoping that there was a configuration that Notepad++ just wasn’t using, but alas, they don’t give us that feature)</p>
<p dir="auto">I dug through the old requests at the Scintilla project (the Lexilla library used to be part of Scintilla as a whole, but it’s been split out to its own project, though it’s still run by the Scintilla organization).  There, I found this <a href="https://sourceforge.net/p/scintilla/feature-requests/470/" rel="nofollow ugc">2007 request for for embedded CSS</a>, and following some of the links, I’ve found it’s been a common request – and later replies, like <a href="https://sourceforge.net/p/scintilla/bugs/1904/#9eb6" rel="nofollow ugc">this one</a> have indicated that unless someone else implements it or pays the Lexilla team to implement it, it’s not going to happen (since the same individual is involved at the separated Lexilla library, I am assuming their position on embedded CSS is still the same).  So, per the official Scintilla/Lexilla replies, it’s technically difficult and highly unlikely to ever happen, so I’d call this one “infeasible” to add to Notepad++.</p>
</blockquote>
<p dir="auto">Since Lexilla doesn’t have it, and no one has volunteered to implement it for them, Notepad++ is unable to support highlighting of embedded CSS inside HTML, which is unfortunate.  (Someone once suggested, though I cannot find it either here or in GitHub, that we should just “see” that there’s embedded CSS, and fork out the CSS lexer instead of the HTML lexer for that part; unfortunately, the Lexilla library doesn’t provide that feature, and it would be hugely complicated (and maybe not at all feasible) for Notepad++ to try to provide that overtop of the Lexilla lexer.  Which is unfortunate, because that would solve all such problems.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105517</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105517</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 22 May 2026 21:37:14 GMT</pubDate></item></channel></rss>