Adds a marker to every theme saying whether it is a dark or light theme. Based on that, it either attaches an "ace_dark" CSS selector to the root of the editor or not. Useful for styling.
This commit is contained in:
parent
d1064ae0e1
commit
44db746f35
24 changed files with 33 additions and 25 deletions
|
|
@ -38,6 +38,7 @@
|
|||
define(function(require, exports, module) {
|
||||
|
||||
exports.cssClass = "ace-clouds";
|
||||
exports.isDark = false;
|
||||
exports.cssText = ".ace-clouds .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
define(function(require, exports, module) {
|
||||
|
||||
exports.cssClass = "ace-clouds-midnight";
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-clouds-midnight .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
define(function(require, exports, module) {
|
||||
|
||||
exports.cssClass = "ace-cobalt";
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-cobalt .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssText = ".ace-crimson-editor .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssText = ".ace-dawn .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssText = ".ace-eclipse .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-idle-fingers .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-kr-theme .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-merbivore .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-merbivore-soft .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-mono-industrial .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-monokai .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-pastel-on-dark .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-solarized-dark .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssText = ".ace-solarized-light .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-tm";
|
||||
exports.cssText = ".ace-tm .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.cssText = ".ace-tomorrow .ace_editor {\
|
||||
exports.isDark = false;
|
||||
exports.cssText = ".ace-tomorrow .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
\
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.cssText = ".ace-tomorrow-night .ace_editor {\
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-tomorrow-night .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
\
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.cssText = ".ace-tomorrow-night-blue .ace_editor {\
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-tomorrow-night-blue .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
\
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.cssText = ".ace-tomorrow-night-bright .ace_editor {\
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-tomorrow-night-bright .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
\
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.cssText = ".ace-tomorrow-night-eighties .ace_editor {\
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-tomorrow-night-eighties .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-twilight";
|
||||
exports.cssText = ".ace-twilight .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssText = ".ace-vibrant-ink .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
|
|
|
|||
|
|
@ -821,6 +821,11 @@ var VirtualRenderer = function(container, theme) {
|
|||
if (_self.$theme)
|
||||
dom.addCssClass(_self.container, _self.$theme);
|
||||
|
||||
if(theme && theme.isDark)
|
||||
dom.addCssClass(_self.container, "ace_dark");
|
||||
else
|
||||
dom.removeCssClass(_self.container, "ace_dark");
|
||||
|
||||
// force re-measure of the gutter width
|
||||
if (_self.$size) {
|
||||
_self.$size.width = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue