2

在 Sublime Text 2 中,对于特定主题,我希望属性使用一种颜色,值使用一种颜色。

background:#FFF url('some/img.png') 10px 10px;

background______(属性名称)应该是一种颜色

#FFF url('some/img.png') 10px 10px ____________(值)应该是另一种颜色(整个值的一种颜色)。

我知道我必须修改主题颜色集,但有人知道怎么做吗?

还有一件事,我不希望冒号后有空格(点击标签时)

我想要“浮动:左;” 而不是“浮动:左;”。有谁知道我在哪里可以设置这个?

谢谢

4

2 回答 2

3

看看这个http://tmtheme-editor.herokuapp.com/ 这对于你的元素样式非常有用..但是如果你喜欢你当前的主题并且你只想在 CSS 中编辑标签、类、id ...等那么你必须编辑你正在使用的主题文件..通常这是在Sublime Text 2\Packages\Color Scheme - Default\skin-name

之后,如果它们不存在以下规则,则必须编辑或添加:

<dict>
        <key>name</key>
        <string>css tag-name</string>
        <key>scope</key>
        <string>meta.selector.css entity.name.tag</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#9EFFFF</string>
        </dict>
    </dict>
    <dict>
        <key>name</key>
        <string>css#id</string>
        <key>scope</key>
        <string>meta.selector.css entity.other.attribute-name.id</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#FFB454</string>
        </dict>
    </dict>
    <dict>
        <key>name</key>
        <string>css.class</string>
        <key>scope</key>
        <string>meta.selector.css entity.other.attribute-name.class</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#5FE461</string>
            <key>fontStyle</key>
            <string> underline</string>
        </dict>
    </dict>
    <dict>
        <key>name</key>
        <string>css property-name:</string>
        <key>scope</key>
        <string>support.type.property-name.css</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#9DF39F</string>
        </dict>
    </dict>
    <dict>
        <key>name</key>
        <string>css property-value;</string>
        <key>scope</key>
        <string>meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#F6F080</string>
        </dict>
    </dict>
    <dict>
        <key>name</key>
        <string>css @at-rule</string>
        <key>scope</key>
        <string>meta.preprocessor.at-rule keyword.control.at-rule</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#F6AA11</string>
        </dict>
    </dict>
    <dict>
        <key>name</key>
        <string>css additional-constants</string>
        <key>scope</key>
        <string>meta.property-value support.constant.named-color.css, meta.property-value constant</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#EDF080</string>
        </dict>
    </dict>
    <dict>
        <key>name</key>
        <string>css constructor.argument</string>
        <key>scope</key>
        <string>meta.constructor.argument.css</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#EB939A</string>
        </dict>
    </dict>

当然你可以填写你喜欢什么颜色的值

于 2012-12-06T13:17:41.293 回答
2

还不确定颜色属性和值,但对于 css 间距,我可能有一个答案。转到C:\Users\<username>\AppData\Roaming\Sublime Text 2\Packages\CSS\css_completions.py第 190 行。更改l.append((p, p + ": "))l.append((p, p + ":"))

于 2012-11-05T21:19:36.207 回答