现在,在我的自定义方案中,如果我写"SELECT * FROM table" ,我有以下颜色:
橙色:“,表 蓝色:SELECT,FROM 粉红色:*那是因为我使用橙色表示字符串和标点符号,蓝色表示关键字,粉红色表示操作符。
使用开发人员工具挖掘我发现当一个字符串实际上是一个SQL查询时,它在CSS链中的某个点上有sql字。 例如,上面的句子是:
<span class="string quoted double single-line sql python"> <span class="punctuation definition string begin python">"</span> <span class="keyword other DML sql">SELECT</span> <span class="keyword operator star sql">*</span> <span class="keyword other DML sql">FROM</span> table<span class="punctuation definition string end python"> </span> </span>所以我的问题是,是否可以编写一些规则,以便我可以将橙色应用于包含单词sql ? 我对改变整体关键字和运算符颜色不感兴趣,仅针对SQL查询。
像$.*sql* { color: @orange; } $.*sql* { color: @orange; } ,但显然这不起作用。
Right now, in my custom scheme, if I write "SELECT * FROM table", I have the following colors:
orange: ", table blue: SELECT, FROM pink: *That's because I'm using orange for strings and punctuation marks, blue for keywords and pink for operators.
Digging with the developer tools I found that when a string is actually a SQL query, it has the sql word at some point in the CSS chain. For instance, the above sentence is:
<span class="string quoted double single-line sql python"> <span class="punctuation definition string begin python">"</span> <span class="keyword other DML sql">SELECT</span> <span class="keyword operator star sql">*</span> <span class="keyword other DML sql">FROM</span> table<span class="punctuation definition string end python"> </span> </span>So my question is, is it possible to write some rule so that I could apply orange to everything that contains the word sql? I'm not interested in changing the overall keywords and operators colors, just for the SQL queries.
Something like $.*sql* { color: @orange; }, but obviously this doesn't work.
最满意答案
用这个
.sql{ color: orange; }它将使用类sql为所有元素提供橙色
use this
.sql{ color: orange; }it will give orange color to all elements with class sql
更多推荐
发布评论