diff --git a/_locales/en/messages.json b/_locales/en/messages.json index bf57d82a..4ea59264 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -96,10 +96,18 @@ "message": "Tab size", "description": "Label for the text box controlling tab size option for the style editor." }, + "cm_theme": { + "message": "Theme", + "description": "Label for the style editor's CSS theme." + }, "dbError": { "message": "An error has occurred using the Stylish database. Would you like to visit a web page with possible solutions?", "description": "Prompt when a DB error is encountered" }, + "default": { + "message": "default", + "description": "Default item in various lists" + }, "deleteStyleLabel": { "message": "Delete", "description": "Label for the button to delete a style" diff --git a/background.js b/background.js index fe199f13..2044a0d6 100644 --- a/background.js +++ b/background.js @@ -392,3 +392,17 @@ function openURL(options) { } }); } + +var codeMirrorThemes = [chrome.i18n.getMessage("default")]; +chrome.runtime.getPackageDirectoryEntry(function(rootDir) { + rootDir.getDirectory("codemirror/theme", {create: false}, function(themeDir) { + themeDir.createReader().readEntries(function(entries) { + entries + .filter(function(entry) { return entry.isFile }) + .sort(function(a, b) { return a.name < b.name ? -1 : 1 }) + .forEach(function(entry) { + codeMirrorThemes.push(entry.name.replace(/\.css$/, "")); + }); + }); + }); +}); diff --git a/edit.html b/edit.html index 60f6100f..f26b2521 100644 --- a/edit.html +++ b/edit.html @@ -276,12 +276,25 @@ #sections > *:not(h2) { padding-left: 0.4rem; } + .applies-type { + width: 30%; + } + } + @media(max-width:500px) { + #options { + -webkit-column-count: 1; + } + #options #tabSize-label { + position: static; + } } + +