括号:自定义主题

Brackets: Custom Theme

我正在尝试制作自定义括号主题。在我创建一个基本的 package.json 文件后,我进入扩展管理器应用主题,因此在编辑 'theme.less' 文件时它会立即应用修复。嗯,我的主题没有出现,我有一个 package.json 文件和一个 theme.less 文件。 package.json代码是:

{
    "name": “MyName.DarkPanja”,
    "title": “DarkPanja”,
    "description": “A Dark Theme By Panja“,
    "homepage": "https://github.com/Coler234/DarkPanja”,
    "version": "1.0.0",
    "author": “MyName <myemail@provider.net> (https://github.com/Coler234/DarkPanja)”,
    "license": "MIT",
    "theme": {
        "file": "theme.less",
        "dark": true,
        "addModeClass": true
    },
    "keywords": ["theme"]
}

theme.less:

@background: #1d1f21;
@foreground: #ddd;
@hotpink: #CC0066;
@pinkpurple: #CC00FF;
@neongreen: #99FF00;

/* Code Styling */

.CodeMirror, .CodeMirror-scroll {
    background-color: @background;
    color: @foreground;
}

.CodeMirror-focused .CodeMirror-activeline-background {
    background: #2f2f2f;
}

.show-line-padding .CodeMirror-focused .CodeMirror-activeline-background {
    box-shadow: inset 15px 0 0 0 #000;
}

.CodeMirror-focused .CodeMirror-activeline {
    .CodeMirror-gutter-elt {
        background: rgba(0, 0, 0, 0.2);
        color: #fff;
    }
    .inline-widget .CodeMirror-gutter-elt {
        color: #767676;    
    }
}

.cm-atom, .cm-string, .cm-string-2, .cm-hr {color: @hotpink;}
.cm-number, .cm-attribute, .cm-plus {color: @pinkpurple;}
.cm-def, .cm-property {color: @neongreen;}
.cm-variable, .cm-variable-2, .cm-variable-3, .cm-operator, .cm-meta, .cm-bracket {color: @foreground;}
.cm-comment {color: #767676;}
.cm-error, .cm-minus {color: #dc322f;}
.cm-header {color: #d85896;}
.cm-link {color: @pinkpurple; text-decoration: none;}
.cm-rangeinfo {color: #656de8;}
.cm-keyword, .cm-qualifier, .cm-builtin, .cm-tag, .cm-quote {color: #656de8;}

/* Extra CSS */

.CodeMirror-searching {
    background-color: #660066;
    &.searching-current-match {
        background-color: #6600CC;
    }
}


.CodeMirror-cursor {
    border-left: 1px solid #c5c8c6 !important;
}

.CodeMirror-gutters {
    background-color: @background;
    border-right: none;
}

.CodeMirror-linenumber {
    color: #767676;
}

.CodeMirror .CodeMirror-selected {
    background: #333f48;
}
.CodeMirror-focused .CodeMirror-selected {
    background: #0099FF;
}

.CodeMirror-matchingbracket, .CodeMirror-matchingtag {
    /* Ensure visibility against gray inline editor background */
    background-color: #2e5c00;
    color: @foreground !important;
}

.CodeMirror-overwrite .CodeMirror-cursor {
    border-left: none !important;
    border-bottom: 1px solid #fff;
}

/*
    CodeMirror's use of descendant selectors for certain styling causes problems when editors are
    nested because, for items in the inner editor, the left-hand clause in the selector will now
    match either the actual containing CodeMirror instance *OR* the outer "host" CodeMirror instance.
    TODO (issue #324): We'll still have problems if editors can be nested more than one level deep,
    or if any other descendant-selector-driven CM styles can differ between inner & outer editors
    (potential problem areas include line wrap and coloring theme: basically, anything in codemirror.css
    that uses a descandant selector where the CSS class name to the left of the space is something
    other than a vanilla .CodeMirror)
 */
.CodeMirror {
    .CodeMirror {
        background: transparent;
    }

    .CodeMirror .CodeMirror-gutters {
        background: transparent;
        border-right: none;
    }

    .CodeMirror .CodeMirror-activeline-background {
        background: transparent;
    }

    .CodeMirror .CodeMirror-activeline .CodeMirror-gutter-elt {
        background: transparent;
        color: #767676;
    }

    .CodeMirror-focused .CodeMirror-activeline-background {
        background: #2f2f2f;
    }

    .CodeMirror-focused .CodeMirror-activeline {
        .CodeMirror-gutter-elt {
            background: rgba(0, 0, 0, 0.2);
            color: #fff;
        }
    }
}

.CodeMirror-foldgutter-open:after {
    color: #666;
}
.CodeMirror-foldgutter-folded:after {
    color: #aaa;
}

.CodeMirror.over-gutter, .CodeMirror-activeline {
    .CodeMirror-foldgutter-open:after {
        color: #888;
    }
}

.CodeMirror-foldmarker {
    border-color: #000;
    color: #ccc;
    background-color: #444;
}

/* Non-editor styling */

.image-view,
.not-editor {
    background-color: @background;
}

.view-pane .image-view {
    color: @foreground;
}

这两个文件都在名为 'DarkPanja' 的文件夹中,位于 Brackets/Extensions/User/DarkPanja。因为那不起作用,所以我将其压缩并将其拖到 Brackets 的扩展管理器中。这也不起作用,所以我将它作为存储库上传到 GitHub 并尝试将其下载为 link: https://github.com/Coler234/DarkPanja。 .zip 错误是:Install/Update 由于以下错误而中止: 根目录(它在闪存驱动器上!):未知内部错误。 GitHub link 说: package.json 文件无效(错误为:SyntaxError: Unexpected Token ")

您需要在JSON中使用普通引号(即"),否则无效。 现在,您正在为 “MyName.DarkPanja”.

等值使用特殊引号